home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / nt4.0 server / UTILITY.IN_ / utility.inf
INI File  |  1996-07-14  |  102KB  |  2,486 lines

  1. [InitBaseVars]
  2. KeyNull            = ""
  3. MAXIMUM_ALLOWED    = 33554432
  4. KeyInfo            = {}
  5. RegistryErrorIndex = NO_ERROR
  6. NoTitle            = 0
  7. CurrentControlSet  = "SYSTEM\CurrentControlSet"
  8. ServicesBaseName   = $(CurrentControlSet)"\Services"
  9. NetworkCardKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
  10. !RegLastError      = NO_ERROR
  11. [RegistryErrorSetup]
  12. RegistryErrorIndex = ^(RegistryErrors$(!STF_LANGUAGE),1)
  13. RegistryErrorList = ^(RegistryErrors$(!STF_LANGUAGE),2)
  14. [RegistryErrorString]
  15.      read-syms RegistryErrorSetup
  16.      read-syms RegistryErrorUnknown$(!STF_LANGUAGE)
  17.      set RE_String = *($(RegistryErrorList),~($(RegistryErrorIndex),$($0)))
  18.      Ifstr $(RE_String) == ""
  19.         set RE_String = $(Error_Bogus)
  20.      endif
  21.      return $(RE_String)
  22. [BaseServiceKey]
  23.     read-syms InitBaseVars
  24.     set BS_KeyServices = ""
  25.     OpenRegKey $(!REG_H_LOCAL) "" $(ServicesBaseName) $(MAXIMUM_ALLOWED) BS_KeyServices
  26.     Ifstr $(BS_KeyServices) == $(KeyNull)
  27.        Debug-Output "UTILITY.INF: could not open Services base key"
  28.        set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  29.     endif
  30. B_S_Return = +
  31.     return $(RegistryErrorIndex), $(BS_KeyServices)
  32. [ReduceInfPath]
  33.     Set RIP_Result = $($0)
  34.     Split-String $(RIP_Result) "\" InList
  35.     Set BasePath = $(!STF_WINDOWSSYSPATH)"\"
  36.     Split-String $(BasePath) "\" BaseList
  37.     Set Indx = 0
  38.     Set Matched = 0
  39.     QueryListSize InListSize, $(InList)
  40.     ForListDo $(BaseList)
  41.         Set-add Indx = $(Indx),1
  42.         Ifint $(Indx) <= $(InListSize)
  43.             Set Instr = *($(InList),$(Indx))
  44.             Ifstr(i) $($) == $(Instr)
  45.                 Set-add Matched = $(Matched),1
  46.             Endif
  47.         Endif
  48.     EndForListDo
  49.     Ifint $(Indx) == $(Matched)
  50.         Set RIP_Result = ""
  51.         Set Indx2 = 0
  52.         ForListDo $(InList)
  53.             Set-add Indx2 = $(Indx2),1
  54.             Ifint $(Indx2) > $(Indx)
  55.                 Set RIP_Result = $(RIP_Result)$($)
  56.             Endif
  57.         EndForListDo
  58.     Endif
  59.     Return $(RIP_Result)
  60. [InstallSoftwareProduct]
  61.     read-syms InitBaseVars
  62.     set IS_MfgName  = $($0)
  63.     set IS_ProdName = $($1)
  64.     set IS_Infname  = $($2)
  65.     set IS_KeySoftware = ""
  66.     set IS_KeyMfg = ""
  67.     set IS_KeyProduct = ""
  68.     set IS_KeyVersion = ""
  69.     set IS_KeyNetRules = ""
  70.     set IS_MfgCreated = 1
  71.     set IS_ProductCreated = 1
  72.     set RegistryErrorIndex = INVALID_DATA_PASSED
  73.     Ifstr(i) $(IS_MfgName) == ""
  74.        goto I_S_Return
  75.     endif
  76.     Ifstr(i) $(IS_ProdName) == ""
  77.        goto I_S_Return
  78.     endif
  79.     set RegistryErrorIndex = NO_ERROR
  80.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase) $(MAXIMUM_ALLOWED) IS_KeySoftware
  81.     Ifstr $(IS_KeySoftware) == $(KeyNull)
  82.        set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  83.        goto I_S_Return
  84.     endif
  85.     CreateRegKey $(IS_KeySoftware) {$(IS_MfgName),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" IS_KeyMfg
  86.     Ifstr $(IS_KeyMfg) == $(KeyNull)
  87.        set IS_MfgCreated = 0
  88.        OpenRegKey $(IS_KeySoftware) "" $(IS_MfgName) $(MAXIMUM_ALLOWED) IS_KeyMfg
  89.        Ifstr $(IS_KeyMfg) == $(KeyNull)
  90.           set RegistryErrorIndex = UNABLE_OPEN_MICROSOFT_KEY
  91.           goto I_S_Return
  92.        endif
  93.     endif
  94.     CreateRegKey $(IS_KeyMfg) {$(IS_ProdName),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" IS_KeyProduct
  95.     Ifstr $(IS_KeyProduct) == $(KeyNull)
  96.        set IS_ProductCreated = 0
  97.        OpenRegKey $(IS_KeyMfg) "" $(IS_ProdName) $(MAXIMUM_ALLOWED) IS_KeyProduct
  98.        Ifstr $(IS_KeyProduct) == $(KeyNull)
  99.           set RegistryErrorIndex = UNABLE_CREATE_PRODUCT_KEY
  100.           goto I_S_Return
  101.        endif
  102.     endif
  103.     CreateRegKey $(IS_KeyProduct) {"CurrentVersion",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" IS_KeyVersion
  104.     Ifstr $(IS_KeyVersion) == $(KeyNull)
  105.        OpenRegKey $(IS_KeyProduct) "" "CurrentVersion" $(MAXIMUM_ALLOWED) IS_KeyVersion
  106.        Ifstr $(IS_KeyVersion) == $(KeyNull)
  107.           set RegistryErrorIndex = UNABLE_CREATE_PRODUCT_VERSION
  108.           goto I_S_Return
  109.        endif
  110.     endif
  111.     set RegistryErrorIndex = NO_ERROR
  112.     CreateRegKey $(IS_KeyVersion) {NetRules,$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" IS_KeyNetRules
  113.     Ifstr $(IS_KeyNetRules) == $(KeyNull)
  114.        OpenRegKey $(IS_KeyVersion) "" NetRules $(MAXIMUM_ALLOWED) IS_KeyNetRules
  115.        Ifstr $(IS_KeyNetRules) == $(KeyNull)
  116.           set RegistryErrorIndex = UNABLE_CREATE_NETRULES_KEY
  117.           goto I_S_Return
  118.        endif
  119.     endif
  120.     Ifstr $(IS_Infname) != ""
  121.        Shell "", ReduceInfPath, $(IS_Infname)
  122.        SetRegValue $(IS_KeyNetRules) {InfName,$(NoTitle),$(!REG_VT_SZ),$($R0)}
  123.     endif
  124. I_S_Return = +
  125.     Ifstr $(IS_KeyProduct) != ""
  126.         Ifint $(IS_ProductCreated) == 1
  127.            Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  128.               Debug-Output "UTILITY.INF: DeleteRegTree Product Key"
  129.               set IS_KeyProduct = ""
  130.            endif
  131.         endif
  132.         Ifstr $(IS_KeyProduct) != ""
  133.            CloseRegKey $(IS_KeyProduct)
  134.         endif
  135.     endif
  136.     Ifstr $(IS_KeyMfg) != ""
  137.         Ifint $(IS_MfgCreated) == 1
  138.            Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  139.               Debug-Output "UTILITY.INF: DeleteRegTree Manufacturer Key"
  140.               set IS_KeyMfg = ""
  141.            endif
  142.         endif
  143.         Ifstr $(IS_KeyMfg) != ""
  144.            CloseRegKey $(IS_KeyMfg)
  145.         endif
  146.     endif
  147.     Ifstr $(IS_KeySoftware) != ""
  148.         CloseRegKey $(IS_KeySoftware)
  149.     endif
  150.     return $(RegistryErrorIndex), $(IS_KeyVersion), $(IS_KeyNetRules)
  151. [AddValueList]
  152.    set RegistryErrorIndex = NO_ERROR
  153.    ForListDo $($1)
  154.        SetRegValue $($0) $($)
  155.        ifint $(RegLastError) != 0
  156.           Debug-Output "UTILITY.INF: Value write fail data: "$($)
  157.           Debug-Output "UTILITY.INF: Value write fail key: "$($0)
  158.           return UNABLE_WRITE_REGISTRY
  159.        endif
  160.    EndForListDo
  161.    return $(RegistryErrorIndex)
  162. [DeleteSoftwareProduct]
  163.    set RegistryErrorIndex = NO_ERROR
  164.    Debug-Output "UTILITY.INF: DeleteRegTree Software Product"
  165.    DeleteRegTree $($0) ""
  166.    return $(RegistryErrorIndex)
  167. [VerExistedDlg]
  168.    set RegistryErrorIndex = NO_ERROR
  169.    set-subst LF = "\n"
  170.    read-syms VerExisted$(!STF_LANGUAGE)
  171.    set DlgText = $($0)+
  172.              $(ver)+
  173.              $($1)+
  174.              $(Text)
  175.    Shell "Subroutn.Inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(DlgText)
  176.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  177.         set RegistryErrorIndex = ERROR
  178.    endif
  179.    return $(RegistryErrorIndex), $($R1)
  180. [CardExistedDlg]
  181.    set RegistryErrorIndex = NO_ERROR
  182.    set ButtonReturn = "OK"
  183.    ifstr(i) $(!STF_GUI_UNATTENDED) != "YES"
  184.        set-subst LF = "\n"
  185.        read-syms CardExisted$(!STF_LANGUAGE)
  186.        set DlgText = $(Text)
  187.        Shell "Subroutn.Inf" SetupMessage $(!STF_LANGUAGE) "WARNING" $(DlgText)
  188.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  189.             set RegistryErrorIndex = ERROR
  190.        endif
  191.        set ButtonReturn = $($R1)
  192.    endif
  193.    return $(RegistryErrorIndex), $(ButtonReturn)
  194. [CreateService]
  195.     read-syms InitBaseVars
  196.     set CS_NameOfService = $($0)
  197.     set CS_DisplayName   = $($1)
  198.     set CS_ImagePath     = $($2)
  199.     set CS_TypeOfService = $($3)
  200.     set CS_Group         = $($4)
  201.     set CS_Dependencies  = $($5)
  202.     set CS_ObjectName    = $($6)
  203.     set CS_EventFile     = $($7)
  204.     set CS_TypeSupported = $($8)
  205.     ifstr(i) $(CS_TypeSupported) == ""
  206.         set CS_TypeSupported = 7
  207.     endif
  208.     set CS_EventLogLocation = $($9)
  209.     ifstr(i) $(CS_EventLogLocation) == ""
  210.         set CS_EventLogLocation = "System"
  211.     endif
  212.     set CS_ErrorControl = $($10)
  213.     ifstr(i) $(CS_ErrorControl) == ""
  214.         set CS_ErrorControl = 1
  215.     endif
  216.     set CS_EventSourceName = $($11)
  217.     ifstr(i) $(CS_EventSourceName) == ""
  218.         set CS_EventSourceName = $(CS_NameOfService)
  219.     endif
  220.     set CS_ParameterMessageFile = $($12)
  221.     set CS_KeyServices   = $($13)
  222.     set CS_KeyTempSvc    = ""
  223.     set CS_KeySvcManager = ""
  224.     set CS_KeyParameters = ""
  225.     set CS_KeyLinkage    = ""
  226.     set CS_UseRegistry   = $(!NTN_ScUseRegistry)
  227.     Debug-Output "UTILITY.INF: [CreateService] entered for "$(CS_NameOfService)
  228.     Ifstr(i) $(CS_UseRegistry) != "YES"
  229.         Ifstr(i) $(CS_UseRegistry) != "NO"
  230.             Set CS_UseRegistry = "NO"
  231.         Endif
  232.     Endif
  233.     Ifstr(i) $(CS_Dependencies) == ""
  234.         Set CS_Dependencies = {}
  235.     Endif
  236.     Ifstr(i) $(CS_KeyServices) == ""
  237.         Shell "", BaseServiceKey
  238.         set RegistryErrorIndex = $($R0)
  239.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  240.            set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  241.            goto C_S_Return
  242.         endif
  243.         set CS_KeyServices = $($R1)
  244.         set CS_KeyServicesOpened = $($R1)
  245.     Endif
  246.     ifstr(i) $(CS_TypeOfService) == "system"
  247.         set TypeValue = 2
  248.         set StartValue = 3
  249.     else-ifstr(i) $(CS_TypeOfService) == "systemstart"
  250.         set TypeValue = 2
  251.         set StartValue = 1
  252.     else-ifstr(i) $(CS_TypeOfService) == "systemauto"
  253.         set TypeValue = 2
  254.         set StartValue = 2
  255.     else-ifstr(i) $(CS_TypeOfService) == "adapter"
  256.         set TypeValue = 4
  257.         set StartValue = 3
  258.         Set CS_UseRegistry = "YES"
  259.     else-ifstr(i) $(CS_TypeOfService) == "kernelauto"
  260.         set TypeValue = 1
  261.         set StartValue = 1
  262.     else-ifstr(i) $(CS_TypeOfService) == "autoserviceshare"
  263.         set TypeValue = 32
  264.         set StartValue = 2
  265.     else-ifstr(i) $(CS_TypeOfService) == "transport"
  266.         set TypeValue = 2
  267.         set StartValue = 3
  268.     else-ifstr(i) $(CS_TypeOfService) == "kernel"
  269.         set TypeValue = 1
  270.         set StartValue = 3
  271.     else-ifstr(i) $(CS_TypeOfService) == "kernelautostart"
  272.         set TypeValue = 1
  273.         set StartValue = 2
  274.     else-ifstr(i) $(CS_TypeOfService) == "kerneldisable"
  275.         set TypeValue = 1
  276.         set StartValue = 4
  277.     else-ifstr(i) $(CS_TypeOfService) == "service"
  278.         set TypeValue = 16
  279.         set StartValue = 3
  280.     else-ifstr(i) $(CS_TypeOfService) == "serviceauto"
  281.         set TypeValue = 16
  282.         set StartValue = 2
  283.     else-ifstr(i) $(CS_TypeOfService) == "servicedisable"
  284.         set TypeValue = 16
  285.         set StartValue = 4
  286.     else-ifstr(i) $(CS_TypeOfService) == "serviceshare"
  287.         set TypeValue = 32
  288.         set StartValue = 3
  289.     else
  290.         Set CS_UseRegistry = "YES"
  291.         Debug-Output "UTILITY.INF: [CreateService] Unrecognized TypeOfService parameter"
  292.         set TypeValue = 4
  293.         set StartValue = 3
  294.     endif
  295.     Ifint $(TypeValue) > 4
  296.         Ifstr(i) $(CS_ObjectName) == ""
  297.             set CS_ObjectName = "LocalSystem"
  298.         Endif
  299.     Endif
  300.     OpenRegKey $(CS_KeyServices) "" $(CS_NameOfService) $(MAXIMUM_ALLOWED) +
  301.         CS_KeyTempSvc
  302.     ifstr $(CS_KeyTempSvc) != $(KeyNull)
  303.         GetRegValue $(CS_KeyTempSvc),"DeleteFlag", DeleteFlagInfo
  304.         set DeleteFlag = *($(DeleteFlagInfo), 4)
  305.         ifint $(DeleteFlag) == 1
  306.             Set RegistryErrorIndex = REBOOT_MACHINE_BEFORE_ADD_ADAPTER
  307.             goto C_S_Return
  308.         endif
  309.     endif
  310.     ifstr(i) $(CS_UseRegistry) == "YES"
  311.         Debug-Output "UTILITY.INF: [CreateService] "$(CS_NameOfService)" using Registry"
  312.         ifstr(i) $(CS_KeyTempSvc) == $(KeyNull)
  313.            CreateRegKey $(CS_KeyServices) {$(CS_NameOfService),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" CS_KeyTempSvc
  314.         else
  315.            Debug-Output "UTILITY.INF: service key "$(CS_NameOfService)" already existed"
  316.            Set RegistryErrorIndex = UNABLE_CREATE_CONFIGURE_SERVICE
  317.            CloseRegKey $(CS_KeyTempSvc)
  318.            Goto C_S_Return
  319.         endif
  320.         Ifstr(i) $(CS_KeyTempSvc) == $(KeyNull)
  321.            Debug-Output "UTILITY.INF: could not create service key "$(CS_NameOfService)
  322.            Set RegistryErrorIndex = UNABLE_CREATE_CONFIGURE_SERVICE
  323.            CloseRegKey $(CS_KeyTempSvc)
  324.            Goto C_S_Return
  325.         else
  326.             set NewValueList = {+
  327.                                {Type,$(NoTitle),$(!REG_VT_DWORD),$(TypeValue)},+
  328.                                {Start,$(NoTitle),$(!REG_VT_DWORD),$(StartValue)},+
  329.                                {ErrorControl,$(NoTitle),$(!REG_VT_DWORD),$(CS_ErrorControl)}+
  330.                                }
  331.             Ifint $(TypeValue) > 4
  332.                 Set NewValueList = >($(NewValueList), +
  333.                         {ObjectName,$(NoTitle),$(!REG_VT_SZ),$(CS_ObjectName)})
  334.             Endif
  335.             ifstr(i) $(CS_Group) != ""
  336.                 set NewValueList = >($(NewValueList), +
  337.                         {Group,$(NoTitle),$(!REG_VT_SZ),$(CS_Group)})
  338.             endif
  339.             ifstr(i) $(CS_ImagePath) != ""
  340.                 set NewValueList = >($(NewValueList), +
  341.                         {ImagePath,$(NoTitle),$(!REG_VT_EXPAND_SZ),$(CS_ImagePath)})
  342.             endif
  343.             ifstr(i) $(CS_Dependencies) != ""
  344.                 ifstr(i) $(CS_Dependencies) != {}
  345.                     set NewValueList = >($(NewValueList), +
  346.                         {Dependencies,$(NoTitle),$(!REG_VT_MULTI_SZ),$(CS_Dependencies)})
  347.                 endif
  348.             endif
  349.             Shell "", AddValueList, $(CS_KeyTempSvc), $(NewValueList)
  350.             set RegistryErrorIndex = $($R0)
  351.             Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  352.                     Debug-Output "Registry error: Add value list"
  353.             endif
  354.         endif
  355.     else
  356.         Debug-Output "UTILITY.INF: [CreateService] "$(CS_NameOfService)" using CreateService() wrapper"
  357.         Set FLibraryErrCtl = 1
  358.         LibraryProcedure CS_CreateResult $(!NCPA_HANDLE), CPlSetup, $(!STF_HWND), CREATESVC,+
  359.             $(CS_NameOfService), $(CS_DisplayName), $(StartValue), $(TypeValue), $(CS_ErrorControl),+
  360.             $(CS_ImagePath), $(CS_Group),$(CS_Dependencies),$(CS_ObjectName)
  361.         Set FLibraryErrCtl = 0
  362.         Set CS_CreateError = *($(CS_CreateResult),1)
  363.         Ifint $(CS_CreateError) != 0
  364.              Debug-Output "UTILITY.INF: CreateService wrapper failed, error: "$(CS_CreateResult)
  365.              Ifint $(CS_CreateError) == 1073
  366.                  Set RegistryErrorIndex = SERVICE_ALREADY_EXISTS
  367.              Else-ifint $(CS_CreateError) == 1072
  368.                  Set RegistryErrorIndex = SERVICE_MARKED_FOR_DELETE
  369.              Else
  370.                  Set RegistryErrorIndex = UNABLE_CREATE_CONFIGURE_SERVICE
  371.              Endif
  372.              CloseRegKey $(CS_KeyTempSvc)
  373.              Goto C_S_Return
  374.         Endif
  375.         OpenRegKey $(CS_KeyServices) "" $(CS_NameOfService) $(MAXIMUM_ALLOWED) CS_KeyTempSvc
  376.         ifstr $(CS_KeyTempSvc) == $(KeyNull)
  377.              Debug-Output "UTILITY.INF: unable to open new service key"
  378.              set RegistryErrorIndex = UNABLE_CREATE_CONFIGURE_SERVICE
  379.              CloseRegKey $(CS_KeyTempSvc)
  380.              Goto C_S_Return
  381.         endif
  382.     endif
  383.     CreateRegKey $(CS_KeyTempSvc) {"Parameters",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" CS_KeyParameters
  384.     ifstr $(CS_KeyParameters) == $(KeyNull)
  385.         OpenRegKey $(CS_KeyTempSvc) "" "Parameters" $(MAXIMUM_ALLOWED) +
  386.             CS_KeyParameters
  387.     endif
  388.     Ifstr $(CS_KeyParameters) == $(KeyNull)
  389.        set RegistryErrorIndex = UNABLE_CREATE_SERVICE_SUBKEY
  390.        CloseRegKey $(CS_KeyTempSvc)
  391.        goto C_S_Return
  392.     endif
  393.     set RegistryErrorIndex = NO_ERROR
  394.     CreateRegKey $(CS_KeyTempSvc) {"Linkage",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" CS_KeyLinkage
  395.     Ifstr $(CS_KeyLinkage) == $(KeyNull)
  396.         OpenRegKey $(CS_KeyTempSvc) "" "Linkage" $(MAXIMUM_ALLOWED) CS_KeyLinkage
  397.     Endif
  398.     Ifstr $(CS_KeyLinkage) == $(KeyNull)
  399.        set RegistryErrorIndex = UNABLE_CREATE_SERVICE_SUBKEY
  400.        CloseRegKey $(CS_KeyTempSvc)
  401.        goto C_S_Return
  402.     endif
  403.     CreateRegKey $(CS_KeyLinkage) {"Disabled",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" CS_KeyDisabled
  404.     Ifstr $(CS_KeyDisabled) == $(KeyNull)
  405.         OpenRegKey $(CS_KeyLinkage) "" "Disabled" $(MAXIMUM_ALLOWED) CS_KeyDisabled
  406.     Endif
  407.     Ifstr $(CS_KeyDisabled) == $(KeyNull)
  408.        set RegistryErrorIndex = UNABLE_CREATE_SERVICE_SUBKEY
  409.        CloseRegKey $(CS_KeyTempSvc)
  410.        CloseRegKey $(CS_KeyLinkage)
  411.        goto C_S_Return
  412.     endif
  413.     CloseRegKey $(CS_KeyDisabled)
  414.     ifstr(i) $(CS_EventFile) != ""
  415.         OpenRegKey $(!REG_H_LOCAL) "" "SYSTEM\CurrentControlSet\Services\EventLog\"$(CS_EventLogLocation) $(MAXIMUM_ALLOWED) CS_KeyEventLog
  416.         Ifstr $(CS_KeyEventLog) == $(KeyNull)
  417.            debug-output "Cannot open eventlog key"
  418.            set RegistryErrorIndex = UNABLE_OPEN_EVENTLOG_SUBKEY
  419.            CloseRegKey $(CS_KeyTempSvc)
  420.            CloseRegKey $(CS_KeyParameters)
  421.            CloseRegKey $(CS_KeyLinkage)
  422.            goto C_S_Return
  423.         else
  424.            CreateRegKey $(CS_KeyEventLog) {$(CS_EventSourceName),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" CS_KeyService
  425.            ifstr(i) $(CS_KeyService) == ""
  426.                OpenRegKey $(CS_KeyEventLog) "" $(CS_EventSourceName) $(MAXIMUM_ALLOWED) CS_KeyService
  427.            endif
  428.            Ifstr $(CS_KeyService) != $(KeyNull)
  429.                SetRegValue $(CS_KeyService) {EventMessageFile,$(NoTitle),$(!REG_VT_EXPAND_SZ),$(CS_EventFile)}
  430.                SetRegValue $(CS_KeyService) {TypesSupported,$(NoTitle),$(!REG_VT_DWORD),$(CS_TypeSupported)}
  431.                ifstr(i) $(CS_ParameterMessageFile) != ""
  432.                    SetRegValue $(CS_KeyService) {ParameterMessageFile,$(NoTitle),$(!REG_VT_EXPAND_SZ),$(CS_ParameterMessageFile)}
  433.                endif
  434.                CloseRegKey $(CS_KeyService)
  435.            endif
  436.         Endif
  437.     endif
  438. C_S_Return = +
  439.     Ifstr $(CS_KeyServicesOpened) != $(KeyNull)
  440.         CloseRegKey $(CS_KeyServices)
  441.     endif
  442.     return $(RegistryErrorIndex), $(CS_KeyTempSvc), $(CS_KeyParameters), $(CS_KeyLinkage)
  443. [AssignAdapterNumber]
  444.     read-syms InitBaseVars
  445.     set AA_KeyNetcards = $($0)
  446.     ifstr $($1) == ""
  447.         set AA_AdapterNumber = 1
  448.     else
  449.         set AA_AdapterNumber = $($1)
  450.     endif
  451.     set AA_KeyNetcards = ""
  452.     set AA_KeyTemp = ""
  453.     set RegistryErrorIndex = NO_ERROR
  454.     Debug-Output "[AssignAdapterNumber] starting with "$(AA_AdapterNumber)
  455.     Ifstr(i) $(AA_KeyNetcards) == $(KeyNull)
  456.         OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardKeyName) $(MAXIMUM_ALLOWED) AA_KeyNetcards
  457.         set AA_KeyNetcardsOpened = $(AA_KeyNetcards)
  458.     endif
  459.     Ifstr $(AA_KeyNetcards) == $(KeyNull)
  460.        set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
  461.        goto A_A_Return
  462.     endif
  463. A_A_TryAgain = +
  464.     ifint $(AA_AdapterNumber) < 10
  465.         set Tmp_Zero_AdapterNumber = "0"$(AA_AdapterNumber)
  466.         OpenRegKey $(AA_KeyNetcards) "" $(Tmp_Zero_AdapterNumber) $(MAXIMUM_ALLOWED) AA_Zero_KeyTemp
  467.         ifstr(i) $(AA_Zero_KeyTemp) != ""
  468.             CloseRegKey $(AA_Zero_KeyTemp)
  469.             goto Next_Number
  470.         endif
  471.     endif
  472.     set Tmp_AA_AdapterNumber = $(AA_AdapterNumber)
  473.     OpenRegKey $(AA_KeyNetcards) "" $(Tmp_AA_AdapterNumber) $(MAXIMUM_ALLOWED) AA_KeyTemp
  474.     Ifstr $(AA_KeyTemp) == $(KeyNull)
  475.         Goto A_A_Found
  476.     Endif
  477.     CloseRegKey $(AA_KeyTemp)
  478. Next_Number = +
  479.     Set AA_KeyTemp = $(KeyNull)
  480.     Set-add AA_AdapterNumber = $(AA_AdapterNumber),1
  481.     Goto A_A_TryAgain
  482. A_A_Found =+
  483.     CloseRegKey $(AA_KeyNetcardsOpened)
  484. A_A_Return = +
  485.     return $(RegistryErrorIndex) $(AA_AdapterNumber)
  486. [InstallNetcard]
  487.    read-syms InitBaseVars
  488.    set IN_Infname     = $($0)
  489.    set IN_KeyNetcardsArea = $($1)
  490.    set IN_CardNumber  = $($2)
  491.    set IN_KeyNetcard  = ""
  492.    set IN_KeyNetRules = ""
  493.     Shell "" AssignAdapterNumber $(IN_KeyNetcardsArea) $(IN_CardNumber)
  494.     set RegistryErrorIndex = $($R0)
  495.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  496.         goto I_N_Return
  497.     endif
  498.     set IN_CardNumber = $($R1)
  499.     CreateRegKey $(!REG_H_LOCAL) {$(NetworkCardKeyName)\$(IN_CardNumber),$(NoTitle),GenericClass} +
  500.                   "" $(MAXIMUM_ALLOWED) "" IN_KeyNetcard
  501.     Ifstr $(IN_KeyNetcard) == $(KeyNull)
  502.        set RegistryErrorIndex = UNABLE_CREATE_NETCARD_CONFIGURATION
  503.        goto I_N_Return
  504.     endif
  505.     CreateRegKey $(IN_KeyNetcard) {NetRules,$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" IN_KeyNetRules
  506.     Ifstr $(IN_KeyNetRules) == $(KeyNull)
  507.        set RegistryErrorIndex = UNABLE_CREATE_NETRULES_KEY
  508.        goto I_N_Return
  509.     endif
  510.     Ifstr $(IN_Infname) != ""
  511.        Shell "", ReduceInfPath, $(IN_Infname)
  512.        SetRegValue $(IN_KeyNetRules) {InfName,$(NoTitle),$(!REG_VT_SZ),$($R0)}
  513.     endif
  514.     set RegistryErrorIndex = NO_ERROR
  515. I_N_Return = +
  516.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  517.         Debug-Output "UTILITY.INF: [InstallNetcard]: "$(RegistryErrorIndex)
  518.         Ifstr $(IN_KeyNetRules) != $(KeyNull)
  519.             CloseRegKey $(IN_KeyNetRules)
  520.             set IN_KeyNetrules = ''
  521.         endif
  522.         set IN_KeyNetcard = ""
  523.     endif
  524.     return $(RegistryErrorIndex), $(IN_KeyNetcard), $(IN_CardNumber), $(IN_KeyNetRules)
  525. [LinkToService]
  526.     read-syms InitBaseVars
  527.     SetRegValue $($0) {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($1)}
  528. L_S_Return = +
  529.     return $(RegistryErrorIndex)
  530. [IncrementRefCount]
  531.     read-syms InitBaseVars
  532.     OpenRegKey $(!REG_H_LOCAL) "" $($0) $(MAXIMUM_ALLOWED) SoftwareKey
  533.     Ifstr $(SoftwareKey) == $(KeyNull)
  534.        Debug-Output "UTILITY.INF: could not open Software base key"
  535.        set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  536.        goto IncrementRefCount_Return
  537.     endif
  538.     GetRegValue $(SoftwareKey),"RefCount", RefCountInfo
  539.     set RefCount = *($(RefCountInfo), 4)
  540.     Set-add RefCount = $(RefCount),1
  541.     SetRegValue $(SoftwareKey) {RefCount,$(NoTitle),$(!REG_VT_DWORD),$(RefCount)}
  542.     CloseRegKey $(SoftwareKey)
  543. IncrementRefCount_Return = +
  544.     return $(RegistryErrorIndex)
  545. [DecrementRefCount]
  546.     read-syms InitBaseVars
  547.     OpenRegKey $(!REG_H_LOCAL) "" $($0) $(MAXIMUM_ALLOWED) SoftwareKey
  548.     Ifstr $(SoftwareKey) == $(KeyNull)
  549.        Debug-Output "UTILITY.INF: could not open Software base key"
  550.        set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  551.        goto DecrementRefCount_Return
  552.     endif
  553.     GetRegValue $(SoftwareKey),"RefCount", RefCountInfo
  554.     set RefCount = *($(RefCountInfo), 4)
  555.     ifint $(RefCount) == 0
  556.         goto DecrementRefCount_Return
  557.     endif
  558.     Set-sub RefCount = $(RefCount),1
  559.     SetRegValue $(SoftwareKey) {RefCount,$(NoTitle),$(!REG_VT_DWORD),$(RefCount)}
  560.     CloseRegKey $(SoftwareKey)
  561. DecrementRefCount_Return = +
  562.     return $(RegistryErrorIndex)
  563. [IsRefCountEqualZero]
  564.     read-syms InitBaseVars
  565.     OpenRegKey $(!REG_H_LOCAL) "" $($0) $(MAXIMUM_ALLOWED) SoftwareKey
  566.     Ifstr $(SoftwareKey) == $(KeyNull)
  567.        Debug-Output "UTILITY.INF: could not open Software base key"
  568.        set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  569.        set RefCountEqualZero = 1
  570.        goto IsRefCountEqualZero_Return
  571.     endif
  572.     GetRegValue $(SoftwareKey),"RefCount", RefCountInfo
  573.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  574.         set RefCount = 0
  575.     else
  576.         set RefCount = *($(RefCountInfo), 4)
  577.     endif
  578.     Ifint $(RefCount) == 0
  579.         set RefCountEqualZero = 1
  580.     else
  581.         set RefCountEqualZero = 0
  582.     endif
  583.     CloseRegKey $(SoftwareKey)
  584. IsRefCountEqualZero_Return = +
  585.     return $(RegistryErrorIndex) $(RefCountEqualZero)
  586. [FindService]
  587.     read-syms InitBaseVars
  588.     set FS_KeyThisService = ""
  589.     set FS_KeyParameters  = ""
  590.     set FS_KeyComponent   = $($0)
  591.     set FS_TypeComponent  = $($1)
  592.     Shell "", BaseServiceKey
  593.     set FS_KeyServices = $($R1)
  594.     set RegistryErrorIndex = $($R0)
  595.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  596.        goto F_S_Return
  597.     endif
  598.     EnumRegValue $(FS_KeyComponent) FS_ValueList
  599.     set FS_SvcName = ""
  600.     ForListDo $(FS_ValueList)
  601.         set FS_ValueName = *($($),1)
  602.         Ifstr(i) $(FS_ValueName) == ServiceName
  603.             set FS_SvcName = *($($),4)
  604.             goto F_S_Break1
  605.         endif
  606.     EndForListDo
  607. F_S_Break1 = +
  608.     Ifstr $(FS_SvcName) == $(KeyNull)
  609.        set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  610.        goto F_S_Return
  611.     endif
  612.     OpenRegKey $(FS_KeyServices) "" $(FS_SvcName) $(MAXIMUM_ALLOWED) FS_KeyThisService
  613.     Ifstr $(FS_KeyThisService) == $(KeyNull)
  614.        set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  615.        goto F_S_Return
  616.     endif
  617.     OpenRegKey $(FS_KeyThisService) "" "Parameters" $(MAXIMUM_ALLOWED) FS_KeyParameters
  618.     Ifstr $(FS_KeyParameters) == $(KeyNull)
  619.        set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  620.        goto F_S_Return
  621.     endif
  622. F_S_Return = +
  623.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  624.         Ifstr $(FS_KeyParameters) != $(KeyNull)
  625.             CloseRegKey $(FS_KeyParameters)
  626.         endif
  627.         Ifstr $(FS_KeyThisService) != $(KeyNull)
  628.            CloseRegKey $(FS_KeyThisService)
  629.         endif
  630.     endif
  631.     return $(RegistryErrorIndex), $(FS_KeyThisService) $(FS_KeyParameters)
  632. [GetServiceParameters]
  633.     read-syms InitBaseVars
  634.     set GP_KeyComponent = $($0)
  635.     set GP_KeyService = ""
  636.     set GP_KeyParameters = ""
  637.     set GP_ValueList  = {}
  638.     FindService $(GP_KeyComponent) $($1)
  639.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  640.         goto G_P_Return
  641.     endif
  642.     set GP_KeyService = $($R1)
  643.     set GP_KeyParameters = $($R2)
  644.     EnumRegValue $(GP_KeyParameters) GP_ValueList
  645. G_P_Return = +
  646.     return $(RegistryErrorIndex) $(GP_KeyService) $(GP_KeyParameters) $(GP_ValueList)
  647. [AddSoftwareComponent]
  648.     read-syms InitBaseVars
  649.     set AS_MfgName       = $($0)
  650.     set AS_ProdName      = $($1)
  651.     set AS_SvcName       = $($2)
  652.     set AS_DisplayName   = $($3)
  653.     set AS_Infname       = $($4)
  654.     set AS_ImagePath     = $($5)
  655.     set AS_ServiceType   = $($6)
  656.     set AS_Group         = $($7)
  657.     set AS_Dependencies  = $($8)
  658.     set AS_ObjectName    = $($9)
  659.     set AS_EventFile     = $($10)
  660.     set AS_TypeSupported = $($11)
  661.     set AS_EventLocation = $($12)
  662.     set AS_ErrorCtlValue = $($13)
  663.     set AS_EventSource   = $($14)
  664.     set AS_ParameterMessageFile = $($15)
  665.     set AS_KeyServicesArea = $($16)
  666.     set AS_KeyVersion    = ""
  667.     set AS_KeyNetRules   = ""
  668.     set AS_KeyService    = ""
  669.     set AS_KeyParameters = ""
  670.     set AS_KeyLinkage    = ""
  671.     Shell "", CreateService,$(AS_SvcName),$(AS_DisplayName),$(AS_ImagePath),+
  672.           $(AS_ServiceType),$(AS_Group),$(AS_Dependencies),$(AS_ObjectName),+
  673.           $(AS_EventFile),$(AS_TypeSupported),$(AS_EventLocation),+
  674.           $(AS_ErrorCtlValue),$(AS_EventSource),$(AS_ParameterMessageFile),+
  675.           $(AS_KeyServicesArea)
  676.     set RegistryErrorIndex = $($R0)
  677.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  678.        goto A_S_Return
  679.     endif
  680.     set AS_KeyService    = $($R1)
  681.     set AS_KeyParameters = $($R2)
  682.     set AS_KeyLinkage    = $($R3)
  683.     Shell "", InstallSoftwareProduct, $(AS_MfgName), $(AS_ProdName), $(AS_Infname)
  684.     set RegistryErrorIndex = $($R0)
  685.     Ifstr(i) $(RegistryErrorIndex) == NO_ERROR
  686.         set AS_KeyVersion  = $($R1)
  687.         set AS_KeyNetRules = $($R2)
  688.         Shell "", LinkToService, $(AS_KeyVersion), $(AS_SvcName), service
  689.         set RegistryErrorIndex = $($R0)
  690.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  691.             goto A_S_Return
  692.         endif
  693.         GetRegValue $(AS_KeyVersion),"RefCount", RefCountInfo
  694.         Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  695.             SetRegValue $(AS_KeyVersion) {RefCount,$(NoTitle),$(!REG_VT_DWORD),0}
  696.         endif
  697.     endif
  698. A_S_Return = +
  699.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  700.        Ifstr $(AS_KeyNetRules) != $(KeyNull)
  701.           CloseRegKey $(AS_KeyNetRules)
  702.        endif
  703.        Ifstr $(AS_KeyParameters) != $(KeyNull)
  704.           CloseRegKey $(AS_KeyParameters)
  705.        endif
  706.        Ifstr $(AS_KeyLinkage) != $(KeyNull)
  707.           CloseRegKey $(AS_KeyLinkage)
  708.        endif
  709.        Ifstr $(AS_KeyVersion) != $(KeyNull)
  710.           CloseRegKey $(AS_KeyVersion)
  711.           Set AS_ProdKeyName = $(!NTN_SoftwareBase)"\"$(AS_MfgName)"\"$(AS_ProdName)
  712.           OpenRegKey $(!REG_H_LOCAL) "" $(AS_ProdKeyName) $(MAXIMUM_ALLOWED) AS_KeyProduct
  713.           Ifstr(i) $(AS_KeyProduct) != $(KeyNull)
  714.               DeleteRegKey $(AS_KeyProduct) "CurrentVersion"
  715.               CloseRegKey $(AS_KeyProduct)
  716.           Endif
  717.        Endif
  718.        Ifstr $(AS_KeyService) != $(KeyNull)
  719.           Debug-Output "UTILITY.INF: DeleteRegTree Service Key"
  720.        endif
  721.        set AS_KeyVersion = ""
  722.        set AS_KeyNetRules = ""
  723.        set AS_KeyService = ""
  724.        set AS_KeyParameters = ""
  725.        set AS_KeyLinkage = ""
  726.     endif
  727.     return $(RegistryErrorIndex), $(AS_KeyVersion), $(AS_KeyNetRules), $(AS_KeyService),+
  728.            $(AS_KeyParameters), $(AS_KeyLinkage)
  729. [AddHardwareComponent]
  730.     read-syms InitBaseVars
  731.     set AH_SvcName       = $($0)
  732.     set AH_Infname       = $($1)
  733.     set AH_SoftwareName  = $($2)
  734.     set AH_KeyServicesArea = $($3)
  735.     set AH_KeyNetcardsArea = $($4)
  736.     set AH_AdapNum       = $($5)
  737.     set AH_KeyNetcard    = ""
  738.     set AH_KeyNetRules   = ""
  739.     set AH_KeyService    = ""
  740.     set AH_KeyParameters = ""
  741.     Shell "", InstallNetcard, $(AH_Infname) $(AH_KeyNetcardsArea) $(AH_AdapNum)
  742.     set RegistryErrorIndex = $($R0)
  743.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  744.         Debug-Output "UTILITY.INF: [AddHardwareComponent] InstallNetcard returned: "$(RegistryErrorIndex)
  745.         goto A_H_Return
  746.     endif
  747.     set AH_KeyNetcard  = $($R1)
  748.     set AH_AdapNum     = $($R2)
  749.     set AH_SvcName     = $(AH_SvcName)$(AH_AdapNum)
  750.     set AH_KeyNetRules = $($R3)
  751.     Shell "", CreateService, $(AH_SvcName), "", "", "adapter","",{},"","","","","","","", $(AH_KeyServicesArea)
  752.     set RegistryErrorIndex = $($R0)
  753.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  754.         Debug-Output "UTILITY.INF: CreateService returned "$(RegistryErrorIndex)
  755.         goto A_H_Return
  756.     endif
  757.     CloseRegKey $($R1)
  758.     set AH_KeyParameters = $($R2)
  759.     CloseRegKey $($R3)
  760.     Shell "", LinkToService, $(AH_KeyNetcard), $(AH_SvcName)
  761.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  762.         Debug-Output "UTILITY.INF: [AddHardwareComponent] LinkToService returned "$(RegistryErrorIndex)
  763.         goto A_H_Return
  764.     endif
  765.     Shell "", IncrementRefCount, $(AH_SoftwareName)
  766.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  767.         Debug-Output "UTILITY.INF: [AddHardwareComponent] IncrementRefCount returned "$(RegistryErrorIndex)
  768.         goto A_H_Return
  769.     endif
  770. A_H_Return = +
  771.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  772.         Debug-Output "UTILITY.INF: [AddHardwareComponent] returning error: "$(RegistryErrorIndex)
  773.         Ifstr(i) $(AH_KeyNetRules) != $(KeyNull)
  774.            CloseRegKey $(AH_KeyNetRules)
  775.         Endif
  776.         Ifstr(i) $(AH_KeyNetcard) != $(KeyNull)
  777.         Endif
  778.         set AH_KeyNetRules = ""
  779.         set AH_KeyNetcard = ""
  780.     endif
  781.     return $(RegistryErrorIndex), $(AH_KeyNetcard), $(AH_KeyNetRules), $(AH_KeyParameters),+
  782.            $(AH_AdapNum), $(AH_SvcName)
  783. [MCAFindBus]
  784.     read-syms InitBaseVars
  785.     set RegistryErrorIndex = NO_ERROR
  786.     set MultifunctionAdapter = "HARDWARE\Description\System\MultifunctionAdapter"
  787.     set InfoList = {}
  788.     OpenRegKey $(!REG_H_LOCAL) "" $(MultifunctionAdapter) $(MAXIMUM_ALLOWED) KeyMultiAdapter
  789.     Ifstr $(KeyMultiAdapter) == $(KeyNull)
  790.         goto MCAFindBus_return
  791.     endif
  792.     EnumRegKey $(KeyMultiAdapter) BusList
  793.     Debug-Output "Buslist"
  794.     Debug-Output $(BusList)
  795.     ForListDo $(BusList)
  796.         set BusNum = *($($),1)
  797.         set RegName = $(MultifunctionAdapter)"\"$(BusNum)
  798.         Debug-Output "BusNum"
  799.         Debug-Output $(BusNum)
  800.         OpenRegKey $(!REG_H_LOCAL) "" $(RegName) $(MAXIMUM_ALLOWED) KeyBus
  801.         ifstr $(KeyBus) != $(KeyNull)
  802.             GetRegValue $(KeyBus),"Configuration Data",ConfigData
  803.             ifstr $(ConfigData) != $(KeyNull)
  804.                 set CardInfo = *($(ConfigData), 4 )
  805.                 set Position = 33
  806.                 set SlotNum = 1
  807.                 QueryListSize ListSize $(CardInfo)
  808. Loop1 =+
  809.                 ifint $(Position) < $(ListSize)
  810.                     set-add NextByte = $(Position), 1
  811.                     ifint *($(CardInfo), $(Position)) == $($0)
  812.                         ifint *($(CardInfo), $(NextByte)) == $($1)
  813.                             LibraryProcedure RealBusNum, $(!LIBHANDLE), GetMCABusInformation, $(KeyBus), "Configuration Data", $(BusNum)
  814.                             Debug-Output $(RealBusNum)
  815.                             set BusNum = *($(RealBusNum),1)
  816.                             Debug-Output $(SlotNum)
  817.                             set-mul mcaid = $($1), 256
  818.                             set-add mcaid = $(mcaid), $($0)
  819.                             set InfoList = >($(InfoList),{$(BusNum),$(SlotNum),$(mcaid)})
  820.                         endif
  821.                     endif
  822.                     set-add Position = $(Position), 6
  823.                     set-add SlotNum = $(SlotNum), 1
  824.                     goto Loop1
  825.                 endif
  826.             endif
  827.             CloseRegKey $(KeyBus)
  828.         endif
  829.     EndForListDo
  830.     CloseRegKey $(KeyMultiAdapter)
  831. MCAFindBus_return = +
  832.     return $(RegistryErrorIndex) $(InfoList)
  833. [EISAFindBus]
  834.     read-syms InitBaseVars
  835.     set MaskNum = $($1)
  836.     ifstr(i) $($1) == ""
  837.         set MaskNum = 16777215  
  838.     endif
  839.     set RegistryErrorIndex = NO_ERROR
  840.     set EISAAdapter = "HARDWARE\Description\System\EISAAdapter"
  841.     set InfoList = {}
  842.     OpenRegKey $(!REG_H_LOCAL) "" $(EISAAdapter) $(MAXIMUM_ALLOWED) KeyEISAAdapter
  843.     Ifstr $(KeyEISAAdapter) == $(KeyNull)
  844.         goto EISAFindBus_return
  845.     endif
  846.     EnumRegKey $(KeyEISAAdapter) BusList
  847.     Debug-Output "Buslist"
  848.     Debug-Output $(BusList)
  849.     ForListDo $(BusList)
  850.         set BusNum = *($($),1)
  851.         OpenRegKey $(!REG_H_LOCAL) "" $(EISAAdapter)"\"$(BusNum) $(MAXIMUM_ALLOWED) KeyEISAAdapterBus
  852.         LibraryProcedure SlotList, $(!LIBHANDLE), GetEisaSlotInformation, $(KeyEISAAdapterBus), "Configuration Data", $($0), $(MaskNum)
  853.         ifstr(i) $(SlotList) != {}
  854.             ForListDo $(SlotList)
  855.                 set SlotNum = $($)
  856.                 ifstr(i) $(SlotNum) != "ERROR"
  857.                     Debug-Output $(BusNum)
  858.                     Debug-Output $(SlotNum)
  859.                     set InfoList = >($(InfoList),{$(BusNum),$(SlotNum),$($0)})
  860.                 endif
  861.             EndForListDo
  862.         endif
  863.     EndForListDo
  864.     CloseRegKey $(KeyEISAAdapter)
  865. EISAFindBus_return = +
  866.     return $(RegistryErrorIndex) $(InfoList)
  867. [GetPCIInformation]
  868.     read-syms InitBaseVars
  869.     set VendorID = $($0)
  870.     set DeviceID = $($1)
  871.     set MultiAdapter = "HARDWARE\Description\System\MultifunctionAdapter"
  872.     set InfoList = {}
  873.     OpenRegKey $(!REG_H_LOCAL) "" $(MultiAdapter) $(MAXIMUM_ALLOWED) KeyMultiAdapter
  874.     Ifstr $(KeyMultiAdapter) == $(KeyNull)
  875.         goto GetPCIInformation_return
  876.     endif
  877.     EnumRegKey $(KeyMultiAdapter) BusList
  878.     Debug-Output "Buslist"
  879.     Debug-Output $(BusList)
  880.     set BusNum = 0
  881.     set index = 0
  882.     ForListDo $(BusList)
  883.         OpenRegKey $(!REG_H_LOCAL) "" $(MultiAdapter)"\"$(index) $(MAXIMUM_ALLOWED) KeyMultiAdapterBus
  884.         GetRegValue $(KeyMultiAdapterBus) "Identifier" IdentifierInfo
  885.         ifstr(i) *($(IdentifierInfo),4) == "PCI"
  886.             set device = 0
  887. next_device = +
  888.             ifint $(device) < 32
  889.                 set function = 0
  890. next_function = +
  891.                 ifint $(function) < 8
  892.                     LibraryProcedure Result, $(!LIBHANDLE), GetPciInformation, $(BusNum), $(device), $(function)
  893.                     debug-output $(BusNum)".."$(device)".."$(function)".."$(Result)
  894.                     ifint *($(Result),1) == 65535
  895.                         Set-add device = $(device),1
  896.                         goto next_device
  897.                     endif
  898.                     ifint *($(Result),1) == $(VendorID)
  899.                         ifint *($(Result),2) == $(DeviceID)
  900.                             set InfoList = >($(InfoList),{$(BusNum),$(device),$(function)})
  901.                         endif
  902.                     endif
  903.                     set-add function = $(function), 1
  904.                     goto next_function                       
  905.                 endif
  906.                 Set-add device = $(device),1
  907.                 goto next_device
  908.             endif
  909. finish_bus = +
  910.             set-add BusNum = $(BusNum),1
  911.         endif
  912.         set-add index = $(index),1
  913.     EndForListDo
  914.     CloseRegKey $(KeyMultiAdapter)
  915. GetPCIInformation_return = +
  916.     return $(InfoList)
  917. [AddNetworkProvider]
  918.     read-syms InitBaseVars
  919.     set RegistryErrorIndex = NO_ERROR
  920.     set ProviderDeviceName = $($3)
  921.     ifstr(i) $(ProviderDeviceName) == ""
  922.         set ProviderDeviceName = $($0)
  923.     endif
  924.     OpenRegKey $(!REG_H_LOCAL) "" $(CurrentControlSet)"\control\NetworkProvider\order" $(MAXIMUM_ALLOWED) OrderKey
  925.     ifstr(i) $(OrderKey) == $(KeyNull)
  926.                   CreateRegKey $(!REG_H_LOCAL) {$(CurrentControlSet)"\control\NetworkProvider\order",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" OrderKey
  927.     endif
  928.     GetRegValue $(OrderKey) "ProviderOrder" OrderValue
  929.     set Order = *($(OrderValue), 4 )
  930.     ifstr(i) $(OrderValue) == $(KeyNull)
  931.                 goto AddFirstProvider
  932.     else-ifstr(i) $(Order) == $(KeyNull)
  933.                 goto AddFirstProvider
  934.     else
  935.                 goto AddProvider
  936.     endif
  937. AddFirstProvider = +
  938.     SetRegValue $(OrderKey) {ProviderOrder,$(NoTitle),$(!REG_VT_SZ),$($0)}
  939.     goto WriteProviderInfo
  940. AddProvider = +
  941.     Split-String $(Order) "," OrderList
  942.     ifContains(i) $($0) in $(OrderList)
  943.     else
  944.         set Order = $(Order)","$($0)
  945.         SetRegValue $(OrderKey) {ProviderOrder,$(NoTitle),$(!REG_VT_SZ),$(Order)}
  946.     endif
  947.     goto WriteProviderInfo
  948. WriteProviderInfo = +
  949.     CloseRegKey $(OrderKey)
  950.     OpenRegKey $(!REG_H_LOCAL) "" $(ServicesBaseName)"\"$($0)"\networkprovider" $(MAXIMUM_ALLOWED) ProviderKey
  951.     Ifstr(i) $(ProviderKey) == $(KeyNull)
  952.         CreateRegKey $(!REG_H_LOCAL) {$(ServicesBaseName)"\"$($0)"\networkprovider",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" ProviderKey
  953.     endif
  954.     set NewValueList = {{Devicename,$(NoTitle),$(!REG_VT_SZ),"\Device\"$(ProviderDeviceName)},+
  955.                         {ProviderPath, $(NoTitle), $(!REG_VT_EXPAND_SZ), $($1)},+
  956.                         {Name, $(NoTitle), $(!REG_VT_SZ), $($2)}}
  957.     Shell "" AddValueList $(ProviderKey) $(NewValueList)
  958.     CloseRegKey $(ProviderKey)
  959. AddNetworkProvider_return = +
  960.     return $(RegistryErrorIndex)
  961. [AddServiceProvider]
  962.     read-syms InitBaseVars
  963.     set RegistryErrorIndex = NO_ERROR
  964.     set ClassNum = $($3)
  965.     ifstr(i) $(ClassNum) == ""
  966.         set ClassNum = 8
  967.     endif
  968.     OpenRegKey $(!REG_H_LOCAL) "" $(CurrentControlSet)"\control\ServiceProvider\order" $(MAXIMUM_ALLOWED) OrderKey
  969.     ifstr(i) $(OrderKey) == $(KeyNull)
  970.         CreateRegKey $(!REG_H_LOCAL) {$(CurrentControlSet)"\control\ServiceProvider\Order",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" OrderKey
  971.         SetRegValue $(OrderKey) {ExcludedProviders,$(NoTitle),$(!REG_VT_MULTI_SZ),{}}
  972.     endif
  973.     GetRegValue $(OrderKey) "ProviderOrder" OrderValue
  974.     set Order = *($(OrderValue), 4 )
  975.     ifstr(i) $(OrderValue) == $(KeyNull)
  976.                 goto AddFirstProvider
  977.     else-ifstr(i) $(Order) == $(KeyNull)
  978.                 goto AddFirstProvider
  979.     else
  980.                 goto AddProvider
  981.     endif
  982. AddFirstProvider = +
  983.     SetRegValue $(OrderKey) {ProviderOrder,$(NoTitle),$(!REG_VT_MULTI_SZ),{$($0)}}
  984.     goto WriteProviderInfo
  985. AddProvider = +
  986.     ifContains(i) $($0) in $(Order)
  987.     else
  988.         set Order = >($(Order),$($0))
  989.         SetRegValue $(OrderKey) {ProviderOrder,$(NoTitle),$(!REG_VT_MULTI_SZ),$(Order)}
  990.     endif
  991.     goto WriteProviderInfo
  992. WriteProviderInfo = +
  993.     CloseRegKey $(OrderKey)
  994.     OpenRegKey $(!REG_H_LOCAL) "" $(ServicesBaseName)"\"$($0)"\Serviceprovider" $(MAXIMUM_ALLOWED) ProviderKey
  995.     Ifstr(i) $(ProviderKey) == $(KeyNull)
  996.         CreateRegKey $(!REG_H_LOCAL) {$(ServicesBaseName)"\"$($0)"\Serviceprovider",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" ProviderKey
  997.     endif
  998.     set NewValueList = {{Class,$(NoTitle),$(!REG_VT_DWORD),$(ClassNum)},+
  999.                         {ProviderPath, $(NoTitle), $(!REG_VT_EXPAND_SZ), $($1)},+
  1000.                         {Name, $(NoTitle), $(!REG_VT_SZ), $($2)}}
  1001.     Shell "" AddValueList $(ProviderKey) $(NewValueList)
  1002.     CloseRegKey $(ProviderKey)
  1003. AddProvider_return = +
  1004.     return $(RegistryErrorIndex)
  1005. [RemoveServiceProvider]
  1006.     read-syms InitBaseVars
  1007.     set RegistryErrorIndex = NO_ERROR
  1008.     OpenRegKey $(!REG_H_LOCAL) "" $(CurrentControlSet)"\control\ServiceProvider\order" $(MAXIMUM_ALLOWED) OrderKey
  1009.     ifstr(i) $(OrderKey) == $(KeyNull)
  1010.         set RegistryErrorIndex = PROVIDER_ORDER_DOES_NOT_EXIST
  1011.         goto RemoveProvider_return
  1012.     endif
  1013.     GetRegValue $(OrderKey) "ProviderOrder" OrderValue
  1014.     set Order = *($(OrderValue), 4 )
  1015.     set NewOrderList = {}
  1016.     set FirstTime = TRUE
  1017.     set Found = FALSE
  1018.     ForListDo $(Order)
  1019.         ifstr(i) $($) != $($0)
  1020.             ifstr(i) $(FirstTime) == TRUE
  1021.                 set FirstTime = FALSE
  1022.                 set NewOrderList = {$($)}
  1023.             else
  1024.                 set NewOrderList = >($(NewOrderList),$($))
  1025.             endif
  1026.         else
  1027.             set Found = TRUE
  1028.         endif
  1029.     EndForListDo
  1030.     ifstr(i) $(Found) == FALSE
  1031.     else
  1032.         ifstr(i) $(NewOrderList) == {}
  1033.             set NewOrderList = ""
  1034.         endif
  1035.         SetRegValue $(OrderKey) {ProviderOrder,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NewOrderList)}
  1036.     endif
  1037.     OpenRegKey $(!REG_H_LOCAL) "" $(ServicesBaseName)\$($0) $(MAXIMUM_ALLOWED) ProviderKey
  1038.     ifstr $(ProviderKey) != $(KeyNull)
  1039.         DeleteRegTree $(ProviderKey) "ServiceProvider"
  1040.     endif
  1041. RemoveProvider_return = +
  1042.     return $(RegistryErrorIndex)
  1043. [RemoveNetworkProvider]
  1044.     read-syms InitBaseVars
  1045.     set RegistryErrorIndex = NO_ERROR
  1046.     OpenRegKey $(!REG_H_LOCAL) "" $(CurrentControlSet)"\control\NetworkProvider\order" $(MAXIMUM_ALLOWED) OrderKey
  1047.     ifstr(i) $(OrderKey) == $(KeyNull)
  1048.         set RegistryErrorIndex = PROVIDER_ORDER_DOES_NOT_EXIST
  1049.         goto RemoveNetworkProvider_return
  1050.     endif
  1051.     GetRegValue $(OrderKey) "ProviderOrder" OrderValue
  1052.     set Order = *($(OrderValue), 4 )
  1053.     Split-String $(Order) "," OrderList
  1054.     set NewOrderList = {}
  1055.     set FirstTime = TRUE
  1056.     set Found = FALSE
  1057.     ForListDo $(OrderList)
  1058.         ifstr(i) $($) != ","
  1059.             ifstr(i) $($) != $($0)
  1060.                 ifstr(i) $(FirstTime) == TRUE
  1061.                     set FirstTime = FALSE
  1062.                     set NewOrderList = $($)
  1063.                 else
  1064.                     set NewOrderList = $(NewOrderList)","$($)
  1065.                 endif
  1066.             else
  1067.                 set Found = TRUE
  1068.             endif
  1069.         endif
  1070.     EndForListDo
  1071.     ifstr(i) $(Found) == FALSE
  1072.     else
  1073.         ifstr(i) $(NewOrderList) == {}
  1074.             set NewOrderList = ""
  1075.         endif
  1076.         SetRegValue $(OrderKey) {ProviderOrder,$(NoTitle),$(!REG_VT_SZ),$(NewOrderList)}
  1077.     endif
  1078.     OpenRegKey $(!REG_H_LOCAL) "" $(ServicesBaseName)\$($0) $(MAXIMUM_ALLOWED) ProviderKey
  1079.     ifstr $(ProviderKey) != $(KeyNull)
  1080.         DeleteRegTree $(ProviderKey) "NetworkProvider"
  1081.     endif
  1082. RemoveNetworkProvider_return = +
  1083.     return $(RegistryErrorIndex)
  1084. [AddNameSpaceProvider]
  1085.     read-syms InitBaseVars
  1086.     set RegistryErrorIndex = NO_ERROR
  1087.     Set FLibraryErrCtl = 1
  1088.     LibraryProcedure Result, $(!NCPA_HANDLE), AddNameSpaceProvider, $($0), $($1), $($2), $($3), $($4)
  1089.     Set FLibraryErrCtl = 0
  1090.     Set ResultError = *($(Result),1)
  1091.     Ifint $(ResultError) != 0
  1092.          Debug-Output "UTILITY.INF: AddNameSpaceProvider wrapper failed, error: "$(Result)
  1093.          Set RegistryErrorIndex = UNABLE_ADD_NAMESPACE_PROVIDER
  1094.          Goto AddNameSpaceProvider_return
  1095.     Endif
  1096. AddNameSpaceProvider_return = +
  1097.     return $(RegistryErrorIndex)
  1098. [RemoveNameSpaceProvider]
  1099.     read-syms InitBaseVars
  1100.     set RegistryErrorIndex = NO_ERROR
  1101.     Set FLibraryErrCtl = 1
  1102.     LibraryProcedure Result, $(!NCPA_HANDLE), RemoveNameSpaceProvider, $($0)
  1103.     Set FLibraryErrCtl = 0
  1104.     Set ResultError = *($(Result),1)
  1105.     Ifint $(ResultError) != 0
  1106.          Debug-Output "UTILITY.INF: RemoveNameSpaceProvider wrapper failed, error: "$(Result)
  1107.          Set RegistryErrorIndex = UNABLE_REMOVE_NAMESPACE_PROVIDER
  1108.          Goto RemoveNameSpaceProvider_return
  1109.     Endif
  1110. RemoveNameSpaceProvider_return = +
  1111.     return $(RegistryErrorIndex)
  1112. [PrepareToCopy]
  1113.     Read-syms ProgressCopy$(!STF_LANGUAGE)
  1114.     Return STATUS_SUCCESSFUL
  1115. [DoAskSource]
  1116.     Set DAS_CWDDIR  = $($0)
  1117.     Set DAS_SRCDIR  = $($1)
  1118.     Set DAS_BUILTIN = $($2)
  1119.     Set DAS_Result  = STATUS_FAILED
  1120.     Ifstr(i) $(!STF_SRCDIR_OVERRIDE) != ""
  1121.         Set DAS_SRCDIR = $(!STF_SRCDIR_OVERRIDE)
  1122.         Set DAS_Result = STATUS_SUCCESSFUL
  1123.         Goto DAS_exit
  1124.     Endif
  1125.     Ifstr(i) $(DAS_BUILTIN) == YES
  1126.         Ifstr(i) $(!NTN_InstallPhase) == primary
  1127.             Ifstr(i) $(!STF_SRCDIR_WINNT) != ""
  1128.                 Set DAS_SRCDIR = $(!STF_SRCDIR_WINNT)
  1129.             Endif
  1130.             Set DAS_Result = STATUS_SUCCESSFUL
  1131.             Goto DAS_exit
  1132.         Endif
  1133.     Else
  1134.         Ifstr(i) $(!NTN_InstallPhase) == primary
  1135.             Set DAS_Result = STATUS_SUCCESSFUL
  1136.             Goto DAS_exit
  1137.         Else
  1138.             Set DAS_SRCDIR = ""            
  1139.         EndIf
  1140.     Endif
  1141.     Debug-Output "UTILITY.INF: [DoAskSource] STF_CWDDIR = "$(DAS_CWDDIR)" STF_SRCDIR = "$(DAS_SRCDIR)
  1142.     Ifstr(i) $(DAS_SRCDIR) == ""
  1143.         Set DAS_SRCDIR = "A:\"
  1144.     Endif
  1145.     Ifstr(i) $(DAS_SRCDIR) == $(!STF_SRCDIR_USED)
  1146.         Set DAS_SRCDIR = $(!STF_SRCDIR_KEYED)
  1147.     Endif
  1148.     Shell "subroutn.inf" DoAskSource $(DAS_SRCDIR)
  1149.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1150.         Debug-Output "UTILITY.INF: shelling SUBROUTN.INF [DoAskSource] failed"
  1151.         goto DAS_exit
  1152.     endif
  1153.     Set DAS_Result = $($R0)
  1154.     Ifstr(i) $(DAS_Result) == STATUS_USERCANCEL
  1155.         Set !p:CommonStatus = STATUS_USERCANCEL
  1156.         goto DAS_exit
  1157.     Endif
  1158.     Set DAS_SRCDIR = $($R1)
  1159.     Set !STF_SRCDIR_USED = $($R1)
  1160.     Set !STF_SRCDIR_KEYED = $($R3)
  1161.     Ifstr(i) $(DAS_BUILTIN) == YES
  1162.         OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft\Windows Nt\CurrentVersion" $(!REG_KEY_WRITE) KeyNt
  1163.         Ifstr(i) $(KeyNt) != ""
  1164.             SetRegValue $(KeyNt) {SourcePath,$(NoTitle),$(!REG_VT_SZ),$(!STF_SRCDIR_USED)}
  1165.             Debug-Output "UTILITY.INF: SourcePath stored is "$(!STF_SRCDIR_USED)
  1166.             CloseRegKey $(KeyNt)
  1167.         Endif
  1168.     Endif
  1169. DAS_exit =+
  1170.     Read-syms ProgressCopy$(!STF_LANGUAGE)
  1171.     Return $(DAS_Result) $(DAS_SRCDIR)
  1172. [RemoveSoftwareComponent]
  1173.     Debug-Output "Remove Software Component..."
  1174.     read-syms InitBaseVars
  1175.     set RS_Manufacturer = $($0)
  1176.     set RS_ProductName  = $($1)
  1177.     set RS_CheckRefCount = $($2)
  1178.     set RS_VersionNum   = "CurrentVersion"
  1179.     set RS_ManufacturerKey = $(!NTN_SoftwareBase)"\"$(RS_Manufacturer)
  1180.     set RS_ProductKey   = $(!NTN_SoftwareBase)"\"$(RS_Manufacturer)"\"$(RS_ProductName)
  1181.     set RS_ProductVerKey        = $(!NTN_SoftwareBase)"\"$(RS_Manufacturer)"\"$(RS_ProductName)"\"$(RS_VersionNum)
  1182.     set RegistryErrorIndex      = NO_ERROR
  1183.     ifstr(i) $(RS_CheckRefCount) != FALSE
  1184.         Shell "", IsRefCountEqualZero, $(RS_ProductVerKey)
  1185.         Ifstr(i) $($R0) != NO_ERROR
  1186.             Debug-Output "UTILITY.INF: [RemoveSoftwareComponent] IsRefCountEqualZero returned "$($R0)
  1187.             goto RemoveSoftwareComponent_Return
  1188.         endif
  1189.         Ifint $($R1) == 0
  1190.             set RegistryErrorIndex = REF_COUNT_NOT_ZERO
  1191.             goto RemoveSoftwareComponent_Return
  1192.         endif
  1193.     endif
  1194.     OpenRegKey $(!REG_H_LOCAL) "" $(RS_ManufacturerKey) $(MAXIMUM_ALLOWED) ProductKey
  1195.     Ifstr $(ProductKey) == $(KeyNull)
  1196.        Debug-Output "UTILITY.INF: could not open Software product key"
  1197.        set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1198.        goto RemoveSoftwareComponent_Return
  1199.     endif
  1200.     DeleteRegTree $(ProductKey) $(RS_ProductName)
  1201.     CloseRegKey $(ProductKey)
  1202.     Shell "" RemoveService, $(RS_ProductName), "YES"
  1203.     Set RS_RemoveError = $($R0)
  1204.     Ifint $(RS_RemoveError) != 0
  1205.          Debug-Output "UTILITY.INF: RemoveService wrapper failed, error: "$(RS_RemoveResult)
  1206.          Set RegistryErrorIndex = UNABLE_REMOVE_CONFIGURE_SERVICE
  1207.          Goto RemoveSoftwareComponent_Return
  1208.     Endif
  1209. RemoveSoftwareComponent_Return = +
  1210.     Return $(RegistryErrorIndex)
  1211. [RemoveHardwareComponent]
  1212.     Debug-Output "Remove Hardware Component..."
  1213.     read-syms InitBaseVars
  1214.     set RH_Manufacturer = $($0)
  1215.     set RH_ProductName  = $($1)
  1216.     set RH_VersionNum   = "CurrentVersion"
  1217.     set RH_ProductKey   = $(!NTN_SoftwareBase)"\"$($0)"\"$($1)"\"$(RH_VersionNum)
  1218.     set RH_NetCardName  = $($2)
  1219.     Split-String $(RH_NetCardName), "\", CardInfo
  1220.     set RH_NetCardNum   = *($(CardInfo),11)
  1221.     set RH_NetCardBase  = *($(CardInfo),1)*($(CardInfo),2)*($(CardInfo),3)*($(CardInfo),4)*($(CardInfo),5)*($(CardInfo),6)*($(CardInfo),7)*($(CardInfo),8)*($(CardInfo),9)
  1222.     set RegistryErrorIndex      = NO_ERROR
  1223.     Shell "", DecrementRefCount, $(RH_ProductKey)
  1224.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1225.         Debug-Output "UTILITY.INF: [AddHardwareComponent] IncrementRefCount returned "$(RegistryErrorIndex)
  1226.         goto RemoveHardwareComponent_Return
  1227.     endif
  1228.     OpenRegKey $(!REG_H_LOCAL) "" $(RH_NetCardBase) $(MAXIMUM_ALLOWED) NetCardKey
  1229.     Ifstr $(NetCardKey) == $(KeyNull)
  1230.        Debug-Output "UTILITY.INF: could not open NetworkCards key"
  1231.        set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1232.        goto RemoveHardwareComponent_Return
  1233.     endif
  1234.     OpenRegKey $(NetCardKey) "" $(RH_NetCardNum) $(MAXIMUM_ALLOWED) NetCardNumKey
  1235.     Ifstr $(NetCardNumKey) == $(KeyNull)
  1236.        Debug-Output "UTILITY.INF: could not open NetworkCards Number key"
  1237.        set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1238.        goto RemoveHardwareComponent_Return
  1239.     endif
  1240.     GetRegValue $(NetCardNumKey),"ServiceName", RH_ServiceNameInfo
  1241.     set RH_ServiceName = *($(RH_ServiceNameInfo), 4)
  1242.     ifstr(i) $(RH_ServiceName) == ""
  1243.         set RH_ServiceName = $(RH_ProductName)$(RH_NetCardNum)
  1244.     endif
  1245.     CloseRegKey $(NetCardNumKey)
  1246.     DeleteRegTree $(NetCardKey) $(RH_NetCardNum)
  1247.     CloseRegKey $(NetCardKey)
  1248.     Shell "", RemoveService, $(RH_ServiceName), "NO"
  1249.     Set RS_RemoveError = $($R0)
  1250.     Ifint $(RS_RemoveError) != 0
  1251.          Debug-Output "UTILITY.INF: RemoveService wrapper failed, error: "$(RS_RemoveResult)
  1252.          Set RegistryErrorIndex = UNABLE_REMOVE_CONFIGURE_SERVICE
  1253.          Goto RemoveHardwareComponent_Return
  1254.     Endif
  1255.     Shell "", IsRefCountEqualZero, $(RH_ProductKey)
  1256.     Ifstr(i) $($R0) != NO_ERROR
  1257.         Debug-Output "UTILITY.INF: [RemoveHardwareComponent] IsRefCountEqualZero returned "$($R0)
  1258.         goto RemoveHardwareComponent_Return
  1259.     endif
  1260.     Ifint $($R1) == 1
  1261.         Debug-Output "Remove software component..."
  1262.         Shell "" RemoveSoftwareComponent, $(RH_Manufacturer), $(RH_ProductName)
  1263.         set RegistryErrorIndex = $($R0)
  1264.     endif
  1265.     debug-output "remove netbios information..."
  1266.     LibraryProcedure Result, $(!NCPA_HANDLE), RemoveRouteFromNETBIOS, $(RH_ServiceName)
  1267. RemoveHardwareComponent_Return = +
  1268.     Return $(RegistryErrorIndex)
  1269. [RemoveService]
  1270.     read-syms InitBaseVars
  1271.     Set RS_SvcName = $($0)
  1272.     Set RS_UseDelSvc = $($1)
  1273.     OpenRegKey $(!REG_H_LOCAL) "" "SYSTEM\CurrentControlSet\Services\"$(RS_SvcName) +
  1274.         $(MAXIMUM_ALLOWED) ServiceKey
  1275.     Ifstr $(ServiceKey) == $(KeyNull)
  1276.         Debug-Output "UTILITY.INF: could not open SYSTEM Service key "$(RS_SvcName)
  1277.         goto RemoveService_Return
  1278.     endif
  1279.     OpenRegKey $(ServiceKey) "" "Parameters" $(MAXIMUM_ALLOWED) ParameterKey
  1280.     Ifstr $(ParameterKey) != $(KeyNull)
  1281.          DeleteRegValue $(ParameterKey) "NbProvider"
  1282.          CloseRegKey $(ParameterKey)
  1283.     Endif
  1284.     CloseRegKey $(ServiceKey)
  1285.     ifstr(i) $(RS_UseDelSvc) == "YES"
  1286.         Set FLibraryErrCtl = 1
  1287.         LibraryProcedure RS_RemoveResult $(!NCPA_HANDLE), CPlSetup, +
  1288.           $(!STF_HWND), DELETESVC, $(RS_SvcName)
  1289.         Set FLibraryErrCtl = 0
  1290.         Set RS_RemoveError = *($(RS_RemoveResult),1)
  1291.         Ifint $(RS_RemoveError) != 0
  1292.              Debug-Output "UTILITY.INF: RemoveService wrapper failed, error: "$(RS_RemoveResult)
  1293.              Set RegistryErrorIndex = UNABLE_REMOVE_CONFIGURE_SERVICE
  1294.              Goto RemoveService_Return
  1295.         Endif
  1296.     else
  1297.         OpenRegKey $(!REG_H_LOCAL) "" "SYSTEM\CurrentControlSet\Services" +
  1298.         $(MAXIMUM_ALLOWED) ServiceKey
  1299.         Ifstr $(ServiceKey) == $(KeyNull)
  1300.            Debug-Output "UTILITY.INF: could not open SYSTEM Service key "$(RS_SvcName)
  1301.            set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1302.            goto RemoveService_Return
  1303.         endif
  1304.         DeleteRegTree $(ServiceKey) $(RS_SvcName)
  1305.         CloseRegKey $(ServiceKey)
  1306.     endif
  1307. RemoveService_Return = +
  1308.     return $(RegistryErrorIndex)
  1309. [IsNetCardAlreadyInstalled]
  1310.     read-syms InitBaseVars
  1311.     set AlreadyExisted  = "NO"
  1312.     set BusNum  = $($0)
  1313.     set SlotNum = $($1)
  1314.     set Description = $($2)
  1315.     set Product = $($3)
  1316.     set SkipDescriptionCheck = $($4)
  1317.     ifstr(i) $(SkipDescriptionCheck) == ""
  1318.         set SkipDescriptionCheck = "NO"
  1319.     endif
  1320.     OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardKeyName) $(MAXIMUM_ALLOWED) IE_KeyNetcards
  1321.     Ifstr $(IE_KeyNetcards) == $(KeyNull)
  1322.        set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
  1323.        goto IE_Return
  1324.     endif
  1325.     EnumRegKey $(IE_KeyNetcards) IE_KeyNameList
  1326.     ForListDo  $(IE_KeyNameList)
  1327.         set IE_KeyName = *($($),1)
  1328.         OpenRegKey $(IE_KeyNetcards) "" $(IE_KeyName) $(MAXIMUM_ALLOWED) IE_Card
  1329.         Ifstr $(IE_Card) == $(KeyNull)
  1330.            set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
  1331.            goto IE_Return
  1332.         endif
  1333.         GetRegValue $(IE_Card),"Description", DescriptionInfo
  1334.         GetRegValue $(IE_Card),"ProductName", ProductNameInfo
  1335.         set CardDescription     = *($(DescriptionInfo), 4)
  1336.         set CardProductName     = *($(ProductNameInfo), 4)
  1337.         ifstr(i) $(SkipDescriptionCheck) == "YES"
  1338.             set CardDescription = $(Description)
  1339.             set CardProductName = $(Product)
  1340.         endif
  1341.         ifstr(i) $(CardDescription) == $(Description)
  1342.             ifstr(i) $(CardProductName) == $(Product)
  1343.                 GetRegValue $(IE_Card), "ServiceName", ServiceNameInfo
  1344.                 set ServiceName = *($(ServiceNameInfo), 4)
  1345.                 OpenRegKey $(!REG_H_LOCAL) "" +
  1346.                    $(ServicesBaseName)"\"$(ServiceName)"\Parameters" +
  1347.                    $(MAXIMUM_ALLOWED) IE_KeyService
  1348.                 Ifstr $(IE_KeyService) == $(KeyNull)
  1349.                    set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
  1350.                    goto IE_Return
  1351.                 endif
  1352.                 GetRegValue $(IE_KeyService), "BusNumber", BusInfo
  1353.                 GetRegValue $(IE_KeyService), "SlotNumber", SlotInfo
  1354.                 set CardBusNum = *($(BusInfo), 4)
  1355.                 set CardSlotNum = *($(SlotInfo), 4)
  1356.                 ifint $(CardBusNum) == $(BusNum)
  1357.                     ifint $(CardSlotNum) == $(SlotNum)
  1358.                         set AlreadyExisted = "YES"
  1359.                     endif
  1360.                 endif
  1361.             endif
  1362.         endif
  1363.     EndForListDo
  1364. IE_Return = +
  1365.     return $(RegistryErrorIndex) $(AlreadyExisted)
  1366. [CopyRegTreeAs]
  1367.     read-syms InitBaseVars
  1368.     Set RegistryErrorIndex = NO_ERROR
  1369.     set CRTA_SrcKey = $($0)
  1370.     set CRTA_BaseDestKey = $($1)
  1371.     set CRTA_DestName = $($2)
  1372.     set CRTA_DestKey = $($1)
  1373.     ifstr(i) $(CRTA_DestName) != ""
  1374.         CreateRegKey $(CRTA_BaseDestKey) {$(CRTA_DestName),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" CRTA_DestKey
  1375.         Ifstr(i) $(CRTA_DestKey) == $(KeyNull)
  1376.            Set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1377.            Goto CRTA_Return
  1378.         Endif
  1379.     endif
  1380.     Set FLibraryErrCtl = 1
  1381.     LibraryProcedure CRTA_CopyResult $(!NCPA_HANDLE), RegCopyTree, $(CRTA_SrcKey), $(CRTA_DestKey) 
  1382.     Set FLibraryErrCtl = 0
  1383.     Set CRTA_CopyError = *($(CRTA_CopyResult),1)
  1384.     Ifint $(CRTA_CopyError) != 0
  1385.         Debug-Output "UTILITY.INF: [CopyRegTreeAs] RegCopyTree returned "$(CRTA_CopyError)
  1386.         Set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1387.         Goto CRTA_Return
  1388.     Endif
  1389. CRTA_Return = +
  1390.     return $(RegistryErrorIndex) $(CRTA_DestKey)
  1391. [UpdateWinsockService]
  1392.     read-syms InitBaseVars
  1393.     Set UW_NameOfService = $($0)
  1394.     Set UW_Adding        = $($1)
  1395.     Set UW_KeyServices   = $(KeyNull)
  1396.     Set UW_KeyParameters = $(KeyNull)
  1397.     Shell "", BaseServiceKey
  1398.     Set RegistryErrorIndex = $($R0)
  1399.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1400.        Set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1401.        Goto U_W_Return
  1402.     endif
  1403.     Set UW_KeyServices = $($R1)
  1404.     OpenRegKey $(UW_KeyServices) "" "WinSock\Parameters" $(MAXIMUM_ALLOWED) UW_KeyParameters
  1405.     Ifstr(i) $(UW_KeyParameters) == $(KeyNull)
  1406.         set UW_KeyWinSock = $(KeyNull)
  1407.         set UW_RestoreKeys = FALSE
  1408.         set UW_TempKeyName = ""
  1409.         set UW_TempKey = $(KeyNull)
  1410.         OpenRegKey $(UW_KeyServices) "" "WinSock" $(MAXIMUM_ALLOWED) UW_KeyWinSock
  1411.         Ifstr(i) $(UW_KeyWinSock) != $(KeyNull)
  1412.             set UW_RestoreKeys = TRUE
  1413.             set UW_TempKeyName = "WinSockMergeVolatile"
  1414.             Shell "", CopyRegTreeAs $(UW_KeyWinSock) $(UW_KeyServices) $(UW_TempKeyName) 
  1415.             set UW_TempKey = $($R1)
  1416.             CloseRegKey $(UW_KeyWinSock)    
  1417.             DeleteRegTree $(UW_KeyServices) "WinSock"
  1418.         Endif
  1419.         Debug-Output "UTILITY.INF:  Create WinSock Service"
  1420.         Shell "", CreateService, "WinSock", "", "", "adapter", "", {}
  1421.         Set RegistryErrorIndex = $($R0)
  1422.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1423.             Debug-Output "UTILITY.INF: CreateService for WinSock returned "$(RegistryErrorIndex)
  1424.             ifstr(i) $(UW_RestoreKeys) == TRUE
  1425.                 CloseRegKey $(UW_TempKey) 
  1426.             Endif
  1427.             Goto U_W_Return
  1428.         Endif
  1429.         set UW_KeyWinSock =  $($R1)
  1430.         Set UW_KeyParameters = $($R2)
  1431.         ifstr(i) $(UW_RestoreKeys) == TRUE
  1432.             Shell "", CopyRegTreeAs $(UW_TempKey) $(UW_KeyWinSock) ""
  1433.             CloseRegKey $(UW_TempKey) 
  1434.             DeleteRegTree $(UW_KeyServices) "WinSockMergeVolatile"
  1435.         Endif
  1436.         CloseRegKey $(UW_KeyWinSock)
  1437.         CloseRegKey $($R3)
  1438.     Else
  1439.         Debug-Output "UTILITY.INF:  Open WinSock Service"
  1440.     Endif
  1441.     Ifstr(i) $(UW_KeyParameters) == $(KeyNull)
  1442.         Set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1443.         Goto U_W_Return
  1444.     Endif
  1445.     GetRegValue $(UW_KeyParameters) "Transports" UW_TransportsValue
  1446.     Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  1447.         Set UW_TransportsList = *($(UW_TransportsValue), 4)
  1448.     Else
  1449.         Set UW_TransportsList = {}
  1450.     Endif
  1451.     Ifstr(i) $(UW_TransportsList) == ""
  1452.         Set UW_TransportsList = {}
  1453.     Endif
  1454.     Ifstr(i) $(UW_Adding) == "TRUE"
  1455.         Set UW_TransportsList = >($(UW_TransportsList), $(UW_NameOfService))
  1456.     Else
  1457.         Set UW_NewList = {}
  1458.         ForListDo $(UW_TransportsList)
  1459.             Ifstr(i) $($) != $(UW_NameOfService)
  1460.                 Set UW_NewList = >($(UW_NewList), $($))
  1461.             Endif
  1462.         EndForListDo
  1463.         Set UW_TransportsList = $(UW_NewList)
  1464.     Endif
  1465.     SetRegValue $(UW_KeyParameters) {Transports, $(NoTitle), $(!REG_VT_MULTI_SZ), $(UW_TransportsList)}
  1466.     Debug-Output "UTILITY.INF:  WinSock transport info added/deleted for "$(UW_NameOfService)
  1467. U_W_Return = +
  1468.     Ifstr $(UW_KeyParameters) != $(KeyNull)
  1469.         CloseRegKey $(UW_KeyParameters)
  1470.     Endif
  1471.     Ifstr $(UW_KeyServices) != $(KeyNull)
  1472.         CloseRegKey $(UW_KeyServices)
  1473.     Endif
  1474.     Return $(RegistryErrorIndex)
  1475. [UpdateWinsockMappings]
  1476.     read-syms InitBaseVars
  1477.     Set AW_NameOfService = $($0)
  1478.     Set AW_DLLName       = $($1)
  1479.     Shell "", BaseServiceKey
  1480.     Set RegistryErrorIndex = $($R0)
  1481.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1482.        Set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1483.        Goto M_W_Return
  1484.     endif
  1485.     OpenRegKey $($R1) "" $(AW_NameOfService)"\Parameters\Winsock" $(MAXIMUM_ALLOWED) KeyWinsock    
  1486.     Ifstr(i) $(KeyWinsock) == ""
  1487.        Set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1488.        Goto M_W_Return
  1489.     Endif
  1490.     Set FLibraryErrCtl = 1
  1491.     LibraryProcedure MW_MapResult $(!NCPA_HANDLE), CPlSetup, $(!STF_HWND), WINSOCKMAP, $(AW_DLLName), $(KeyWinsock)
  1492.     Set FLibraryErrCtl = 0
  1493.     Set AW_MapError = *($(MW_MapResult),1)
  1494.     Ifint $(AW_MapError) != 0
  1495.         Debug-Output "UTILITY.INF: [UpdateWinsockMappings] WINSOCKMAP returned "$(AW_MapError)
  1496.         Set RegistryErrorIndex = UNABLE_ACCESS_WINSOCK_MAP_INFO
  1497.         Goto M_W_Return
  1498.     Endif
  1499. M_W_Return = +
  1500.     Ifstr $(KeyWinsock) != $(KeyNull)
  1501.         CloseRegKey $(KeyWinsock)
  1502.     Endif
  1503.     Return $(RegistryErrorIndex)
  1504. [AddWinsockInfo]
  1505.     read-syms InitBaseVars
  1506.     Set AW_NameOfService = $($0)
  1507.     Set AW_DLLName       = $($1)
  1508.     Set AW_MaxAddrLgt    = $($2)
  1509.     Set AW_MinAddrLgt    = $($3)
  1510.     Set AW_KeyServices   = $(KeyNull)
  1511.     Set AW_KeyParameters = $(KeyNull)
  1512.     Set AW_KeySockets    = $(KeyNull)
  1513.     Shell "", AddAFD
  1514.     Set RegistryErrorIndex = $($R0)
  1515.     Ifstr(i) $(RegistryErrorIndex) == NO_ERROR
  1516.         Shell "", BaseServiceKey
  1517.         Set RegistryErrorIndex = $($R0)
  1518.     Endif
  1519.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1520.        Set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1521.        Goto A_W_Return
  1522.     endif
  1523.     Set AW_KeyServices = $($R1)
  1524.     OpenRegKey $(AW_KeyServices) "" $(AW_NameOfService)"\Parameters" $(MAXIMUM_ALLOWED) AW_KeyParameters
  1525.     Ifstr(i) $(AW_KeyParameters) == $(KeyNull)
  1526.        Set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1527.        Goto A_W_Return
  1528.     Endif
  1529.     OpenRegKey $(AW_KeyParameters) "" "Winsock" $(MAXIMUM_ALLOWED) AW_KeySockets
  1530.     Ifstr(i) $(AW_KeySockets) == $(KeyNull)
  1531.         CreateRegKey $(AW_KeyParameters) {Winsock,$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" AW_KeySockets
  1532.     Endif
  1533.     Ifstr(i) $(AW_KeySockets) == $(KeyNull)
  1534.        Set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1535.        Goto A_W_Return
  1536.     Endif
  1537.     Set AW_ValueList = {{HelperDllName    ,$(NoTitle),$(!REG_VT_EXPAND_SZ),$(AW_DLLName)},+
  1538.                         {MaxSockAddrLength,$(NoTitle),$(!REG_VT_DWORD),$(AW_MaxAddrLgt)},+
  1539.                         {MinSockAddrLength,$(NoTitle),$(!REG_VT_DWORD),$(AW_MinAddrLgt)}}
  1540.     Shell "", AddValueList, $(AW_KeySockets), $(AW_ValueList)
  1541.     Set RegistryErrorIndex = $($R0)
  1542.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1543.         Debug-Output "UTILITY.INF: [AddWinsockInfo] Registry error: Add value list"
  1544.     Endif
  1545.     Set FLibraryErrCtl = 1
  1546.     LibraryProcedure AW_MapResult $(!NCPA_HANDLE), CPlSetup, $(!STF_HWND), WINSOCKMAP, $(AW_DLLName), $(AW_KeySockets)
  1547.     Set FLibraryErrCtl = 0
  1548.     Set AW_MapError = *($(AW_MapResult),1)
  1549.     Ifint $(AW_MapError) != 0
  1550.         Debug-Output "UTILITY.INF: [AddWinsockInfo] WINSOCKMAP returned "$(AW_MapError)
  1551.         Set RegistryErrorIndex = UNABLE_ACCESS_WINSOCK_MAP_INFO
  1552.         Goto A_W_Return
  1553.     Endif
  1554.     Shell "" UpdateWinsockService $(AW_NameOfService) TRUE
  1555.     Set RegistryErrorIndex = $($R0)
  1556. A_W_Return = +
  1557.     Ifstr $(AW_KeySockets) != $(KeyNull)
  1558.         CloseRegKey $(AW_KeySockets)
  1559.     Endif
  1560.     Ifstr $(AW_KeyParameters) != $(KeyNull)
  1561.         CloseRegKey $(AW_KeyParameters)
  1562.     Endif
  1563.     Ifstr $(AW_KeyServices) != $(KeyNull)
  1564.         CloseRegKey $(AW_KeyServices)
  1565.     Endif
  1566.     Return $(RegistryErrorIndex)
  1567. [RemoveWinsockInfo]
  1568.     read-syms InitBaseVars
  1569.     Set RW_NameOfService = $($0)
  1570.     Set RW_KeyServices   = $(KeyNull)
  1571.     Set RW_KeySockets    = $(KeyNull)
  1572.     Shell "", BaseServiceKey
  1573.     Set RegistryErrorIndex = $($R0)
  1574.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1575.        Set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1576.        Goto R_W_Return
  1577.     endif
  1578.     Set RW_KeyServices = $($R1)
  1579.     OpenRegKey $(RW_KeyServices) "" $(RW_NameOfService)"\Parameters" $(MAXIMUM_ALLOWED) RW_KeySockets
  1580.     Ifstr(i) $(RW_KeySockets) == $(KeyNull)
  1581.        Set RegistryErrorIndex = NO_ERROR
  1582.     else
  1583.        DeleteRegTree $(RW_KeySockets) "Winsock"
  1584.     Endif
  1585.     Shell "" UpdateWinsockService $(RW_NameOfService) FALSE
  1586.     Set RegistryErrorIndex = $($R0)
  1587. R_W_Return = +
  1588.     Ifstr $(RW_KeySockets) != $(KeyNull)
  1589.         CloseRegKey $(RW_KeySockets)
  1590.     Endif
  1591.     Ifstr $(RW_KeyServices) != $(KeyNull)
  1592.         CloseRegKey $(RW_KeyServices)
  1593.     Endif
  1594.     Return $(RegistryErrorIndex)
  1595. [BindingInfo-DEC]
  1596. BindingInfo     = {+
  1597.                   "lanceDriver dec100Adapter non exclusive 100",+
  1598.                   "lanceDriver dec101Adapter non exclusive 100",+
  1599.                   "lanceDriver decetherworksturboAdapter non exclusive 100",+
  1600.                   "lanceDriver dec422Adapter non exclusive 100",+
  1601.                   "lanceDriver decpcAdapter non exclusive 100",+
  1602.                   "lanceDriver decstatAdapter non exclusive 100"+
  1603.                   }
  1604. [BindingInfo-WD]
  1605. BindingInfo     = {+
  1606.                           "smc8000nDriver smcisaAdapter non exclusive 100",+
  1607.                           "smc8000nDriver wd8003eaAdapter non exclusive 100",+
  1608.                           "smc8000nDriver wd8003waAdapter non exclusive 100",+
  1609.                           "smc8000nDriver wd8013epaAdapter non exclusive 100",+
  1610.                           "smc8000nDriver wd8013wpaAdapter non exclusive 100"+
  1611.                           }
  1612. [BindingInfo-PROTEON]
  1613. BindingInfo     = {+
  1614.                            "proteonDriver p1990Adapter non exclusive 100",+
  1615.                            "proteonDriver p1390Adapter non exclusive 100"+
  1616.                           }
  1617. [BindingInfo-PRONET16]
  1618. BindingInfo     = {+
  1619.                            "pronet16Driver p199XAdapter non exclusive 100",+
  1620.                            "pronet16Driver p139XAdapter non exclusive 100"+
  1621.                           }
  1622. [BindingInfo-IBMTOK2E]
  1623. BindingInfo     = {+
  1624.                            "ibmtok2eDriver ibmtok2eAdapter non exclusive 100"+
  1625.                           }
  1626. [BindingInfo-IBM]
  1627. BindingInfo     = {"ibmtokDriver ibmtokAdapter non exclusive 100",+
  1628.                    "ibmtokDriver ibmtokmcAdapter non exclusive 100"}
  1629. [GetBindingInfo]
  1630.     set BindingInfo = {}
  1631.     read-syms BindingInfo-$($0)
  1632.     return "NO_ERROR", $(BindingInfo)
  1633. [AddStreams]
  1634.     read-syms InitBaseVars
  1635.     OpenRegKey $(!REG_H_LOCAL) "" $(ServicesBaseName)"\streams" $(MAXIMUM_ALLOWED) BS_KeyServices
  1636.     Ifstr $(BS_KeyServices) == $(KeyNull)
  1637.         set OldOption = $(!NTN_InfOption)
  1638.         set !NTN_InfOption = STREAMS
  1639.         Shell "oemnxpst.inf" InstallOption $(!STF_LANGUAGE) "STREAMS" $(!STF_SRCDIR) $(!NtLmAddCopy) $(!NtLmDoCopy) $(!NtLmDoConfig)
  1640.         set !NTN_InfOption = $(OldOption)
  1641.     else
  1642.         CloseRegKey $(BS_KeyServices)
  1643.         Debug-Output "UTILITY.INF: streams already installed"
  1644.     endif
  1645.     Shell "", IncrementRefCount, "Software\Microsoft\streams\CurrentVersion"
  1646. AddStreamsReturn = +
  1647.     return NO_ERROR
  1648. [RemoveStreams]
  1649.     read-syms InitBaseVars
  1650.     OpenRegKey $(!REG_H_LOCAL) "" $(ServicesBaseName)"\streams" $(MAXIMUM_ALLOWED) BS_KeyServices
  1651.     Ifstr $(BS_KeyServices) != $(KeyNull)
  1652.         CloseRegKey $(BS_KeyServices)
  1653.         Shell "", DecrementRefCount, "Software\Microsoft\streams\CurrentVersion"
  1654.         Shell "", IsRefCountEqualZero, "Software\Microsoft\streams\CurrentVersion"
  1655.         Ifstr(i) $($R0) != NO_ERROR
  1656.             Debug-Output "UTILITY.INF: [RemoveSoftwareComponent] IsRefCountEqualZero returned "$($R0)
  1657.             goto RemoveStreamsReturn
  1658.         endif
  1659.         Ifint $($R1) != 1
  1660.             goto RemoveStreamsReturn
  1661.         endif
  1662.         set OldOption = $(!NTN_InfOption)
  1663.         set OldInstallMode = $(!NTN_InstallMode)
  1664.         set !NTN_InfOption = STREAMS
  1665.         set !NTN_InstallMode = deinstall
  1666.         Shell "oemnxpst.inf" InstallOption $(!STF_LANGUAGE) "STREAMS" $(!STF_SRCDIR) $(!NtLmAddCopy) $(!NtLmDoCopy) $(!NtLmDoConfig)
  1667.         set !NTN_InfOption = $(OldOption)
  1668.         set !NTN_InstallMode = $(OldInstallMode)
  1669.     endif
  1670. RemoveStreamsReturn = +
  1671.     return NO_ERROR
  1672. [AddAFD]
  1673.     read-syms InitBaseVars
  1674.     read-syms AFDVars
  1675.     Set Result = NO_ERROR
  1676.     OpenRegKey $(!REG_H_LOCAL) "" $(ServicesBaseName)"\AFD" $(MAXIMUM_ALLOWED) BS_KeyServices
  1677.     Ifstr $(BS_KeyServices) == $(KeyNull)
  1678.         Shell "", CreateService, $(ProductAFDName),+
  1679.             $(ProductAFDTitle),+
  1680.             $(ProductAFDImagePath),+
  1681.             $(ProductAFDSvcType), "TDI", {}, "",+
  1682.             "%SystemRoot%\System32\IoLogMsg.dll"
  1683.         Set Result = $($R0)
  1684.     else
  1685.         CloseRegKey $(BS_KeyServices)
  1686.     endif
  1687. AddAFDReturn = +
  1688.     return $(Result)
  1689. [UpgradeAFD]
  1690.     read-syms InitBaseVars
  1691.     Set Result = NO_ERROR
  1692.     OpenRegKey $(!REG_H_LOCAL) "" $(ServicesBaseName)"\AFD" $(MAXIMUM_ALLOWED) BS_KeyServices
  1693.     Ifstr $(BS_KeyServices) != $(KeyNull)
  1694.         SetRegValue $(BS_KeyServices) {Group,$(NoTitle),$(!REG_VT_SZ),"TDI"}
  1695.         CloseRegKey $(BS_KeyServices)
  1696.     endif
  1697.     return $(Result)
  1698. [GetBusTypeNum]
  1699.     read-syms InitBaseVars
  1700.     set DetCard = $(!p:DetectedCard)
  1701.     ifstr(i) $(DetCard) == ""
  1702.         set DetCard = FALSE
  1703.     endif
  1704.     ifstr(i) $(DetCard) == FALSE
  1705.         set BusType = 1
  1706.         ifstr(i) $(!STF_BUSTYPE) == "ISA"
  1707.             set BusType = 1
  1708.         else-ifstr(i) $(!STF_BUSTYPE) == "EISA"
  1709.             set BusType = 2
  1710.         else-ifstr(i) $(!STF_BUSTYPE) == "Jazz-Internal Bus"
  1711.             set BusType = 0
  1712.         else-ifstr(i) $(!STF_BUSTYPE) == "MCA"
  1713.             set BusType = 3
  1714.         else-ifstr(i) $(!STF_BUSTYPE) == "TCChannel"
  1715.             set BusType = 4
  1716.         else-ifstr(i) $(!STF_BUSTYPE) == "PCI"
  1717.             set BusType = 5
  1718.         else-ifstr(i) $(!STF_BUSTYPE) == "PCMCIA"
  1719.             set BusType = 1
  1720.         else
  1721.             debug-output "Utility.inf: Unknown bus type"
  1722.         endif
  1723.     else
  1724.         set BusType = *($(!STF_NCDETINFO),5)
  1725.     endif
  1726.     return NO_ERROR, $(BusType)
  1727. [AddRpcProtocol]
  1728.     Set ARP_Protocol = $($0)
  1729.     Set ARP_ClientDll = $($1)
  1730.     Set ARP_ServerDll = $($2)
  1731.     read-syms InitBaseVars
  1732.     Set ARP_KeyRpc = $(KeyNull)
  1733.     Set ARP_KeyRpcServer = $(KeyNull)
  1734.     Set ARP_KeyRpcClient = $(KeyNull)
  1735.     Set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  1736.     OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft\Rpc" $(MAXIMUM_ALLOWED) ARP_KeyRpc
  1737.     Ifstr(i) $(ARP_KeyRpc) == $(KeyNull)
  1738.        Goto ARP_Return
  1739.     Endif
  1740.     OpenRegKey $(ARP_KeyRpc) "" "ClientProtocols" $(MAXIMUM_ALLOWED) ARP_KeyClient
  1741.     Ifstr(i) $(ARP_KeyClient) == $(KeyNull)
  1742.        Goto ARP_Return
  1743.     Endif
  1744.     OpenRegKey $(ARP_KeyRpc) "" "ServerProtocols" $(MAXIMUM_ALLOWED) ARP_KeyServer
  1745.     Ifstr(i) $(ARP_KeyServer) == $(KeyNull)
  1746.        Goto ARP_Return
  1747.     Endif
  1748.     SetRegValue $(ARP_KeyClient) {$(ARP_Protocol),$(NoTitle),$(!REG_VT_SZ),$(ARP_ClientDll)}
  1749.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1750.         Goto ARP_Return
  1751.     Endif
  1752.     SetRegValue $(ARP_KeyServer) {$(ARP_Protocol),$(NoTitle),$(!REG_VT_SZ),$(ARP_ServerDll)}
  1753.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1754.         Goto ARP_Return
  1755.     Endif
  1756.     Set RegistryErrorIndex = NO_ERROR
  1757. ARP_Return = +
  1758.     Ifstr(i) $(ARP_KeyServer) != $(KeyNull)
  1759.         CloseRegKey $(ARP_KeyServer)
  1760.     Endif
  1761.     Ifstr(i) $(ARP_KeyClient) != $(KeyNull)
  1762.         CloseRegKey $(ARP_KeyClient)
  1763.     Endif
  1764.     Ifstr(i) $(ARP_KeyRpc) != $(KeyNull)
  1765.         CloseRegKey $(ARP_KeyRpc)
  1766.     Endif
  1767.     Return  $(RegistryErrorIndex)
  1768. [AddClientRpcProtocol]
  1769.     Set ARP_Protocol = $($0)
  1770.     Set ARP_ClientDll = $($1)
  1771.     read-syms InitBaseVars
  1772.     Set ARP_KeyRpc = $(KeyNull)
  1773.     Set ARP_KeyRpcClient = $(KeyNull)
  1774.     Set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  1775.     OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft\Rpc" $(MAXIMUM_ALLOWED) ARP_KeyRpc
  1776.     Ifstr(i) $(ARP_KeyRpc) == $(KeyNull)
  1777.        Goto ARP_Return
  1778.     Endif
  1779.     OpenRegKey $(ARP_KeyRpc) "" "ClientProtocols" $(MAXIMUM_ALLOWED) ARP_KeyClient
  1780.     Ifstr(i) $(ARP_KeyClient) == $(KeyNull)
  1781.        Goto ARP_Return
  1782.     Endif
  1783.     SetRegValue $(ARP_KeyClient) {$(ARP_Protocol),$(NoTitle),$(!REG_VT_SZ),$(ARP_ClientDll)}
  1784.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1785.         Goto ARP_Return
  1786.     Endif
  1787.     Set RegistryErrorIndex = NO_ERROR
  1788. ARP_Return = +
  1789.     Ifstr(i) $(ARP_KeyClient) != $(KeyNull)
  1790.         CloseRegKey $(ARP_KeyClient)
  1791.     Endif
  1792.     Ifstr(i) $(ARP_KeyRpc) != $(KeyNull)
  1793.         CloseRegKey $(ARP_KeyRpc)
  1794.     Endif
  1795.     Return  $(RegistryErrorIndex)
  1796. [AddServerRpcProtocol]
  1797.     Set ARP_Protocol = $($0)
  1798.     Set ARP_ServerDll = $($1)
  1799.     read-syms InitBaseVars
  1800.     Set ARP_KeyRpc = $(KeyNull)
  1801.     Set ARP_KeyRpcServer = $(KeyNull)
  1802.     Set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  1803.     OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft\Rpc" $(MAXIMUM_ALLOWED) ARP_KeyRpc
  1804.     Ifstr(i) $(ARP_KeyRpc) == $(KeyNull)
  1805.        Goto ARP_Return
  1806.     Endif
  1807.     OpenRegKey $(ARP_KeyRpc) "" "ServerProtocols" $(MAXIMUM_ALLOWED) ARP_KeyServer
  1808.     Ifstr(i) $(ARP_KeyServer) == $(KeyNull)
  1809.        Goto ARP_Return
  1810.     Endif
  1811.     SetRegValue $(ARP_KeyServer) {$(ARP_Protocol),$(NoTitle),$(!REG_VT_SZ),$(ARP_ServerDll)}
  1812.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1813.         Goto ARP_Return
  1814.     Endif
  1815.     Set RegistryErrorIndex = NO_ERROR
  1816. ARP_Return = +
  1817.     Ifstr(i) $(ARP_KeyServer) != $(KeyNull)
  1818.         CloseRegKey $(ARP_KeyServer)
  1819.     Endif
  1820.     Ifstr(i) $(ARP_KeyRpc) != $(KeyNull)
  1821.         CloseRegKey $(ARP_KeyRpc)
  1822.     Endif
  1823.     Return  $(RegistryErrorIndex)
  1824. [UpgradeRPCMapConstants]
  1825. DLLClientList = { "rpcltc3.dll", "rpcltc6.dll", "rpcltc5.dll", "rpcltc7.dll", "rpcdgc3.dll" }
  1826. DLLServerList = { "rpclts3.dll", "rpclts6.dll", "rpclts5.dll", "rpclts7.dll", "rpcdgs3.dll" }
  1827. [AddMixRpcProtocol]
  1828.     set ServiceA = $($0)
  1829.     set ServiceB = $($1)
  1830.     Set ARP_Protocol = $($2)
  1831.     Set ARP_ClientDll = $($3)
  1832.     Set ARP_ServerDll = $($4)
  1833.     read-syms InitBaseVars
  1834.     read-syms UpgradeRPCMapConstants
  1835.     OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\"$(ServiceA) $(MAXIMUM_ALLOWED) KeyServiceA
  1836.     OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\"$(ServiceB) $(MAXIMUM_ALLOWED) KeyServiceB
  1837.     ifstr(i) $(KeyServiceA) != $(KeyNull)
  1838.         ifstr(i) $(KeyServiceB) != $(KeyNull)
  1839.             Ifcontains(i) $(ARP_ClientDll) in $(DLLClientList)
  1840.                 Debug-Output "UTILITY.INF: AddMixRpcProtocol tried to add old "$(ARP_ClientDll)", changed to RpcLtCCM.DLL!"
  1841.                 set ARP_ClientDll = "rpcltccm.dll"
  1842.             Endif
  1843.             Ifcontains(i) $(ARP_ServerDll) in $(DLLServerList)
  1844.                 Debug-Output "UTILITY.INF: AddMixRpcProtocol tried to add old "$(ARP_ServerDll)", changed to RpcLtSCM.DLL!"
  1845.                 set ARP_ServerDll = "rpcltscm.dll"
  1846.             Endif
  1847.             Shell "" AddRpcProtocol $(ARP_Protocol) $(ARP_ClientDll) $(ARP_ServerDll)
  1848.             set ReturnCode = $($R0)
  1849.         endif
  1850.     endif
  1851.     set ReturnCode = NO_ERROR
  1852. return_AddMixRpcProtocl = +
  1853.     return $(ReturnCode)
  1854. [RemoveRpcProtocol]
  1855.     Set RRP_Protocol = $($0)
  1856.     read-syms InitBaseVars
  1857.     Set RRP_KeyRpc = $(KeyNull)
  1858.     Set RRP_KeyRpcServer = $(KeyNull)
  1859.     Set RRP_KeyRpcClient = $(KeyNull)
  1860.     Set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  1861.     OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft\Rpc" $(MAXIMUM_ALLOWED) RRP_KeyRpc
  1862.     Ifstr(i) $(RRP_KeyRpc) == $(KeyNull)
  1863.        Goto RRP_Return
  1864.     Endif
  1865.     OpenRegKey $(RRP_KeyRpc) "" "ClientProtocols" $(MAXIMUM_ALLOWED) RRP_KeyClient
  1866.     Ifstr(i) $(RRP_KeyClient) == $(KeyNull)
  1867.        Goto RRP_Return
  1868.     Endif
  1869.     OpenRegKey $(RRP_KeyRpc) "" "ServerProtocols" $(MAXIMUM_ALLOWED) RRP_KeyServer
  1870.     Ifstr(i) $(RRP_KeyServer) == $(KeyNull)
  1871.        Goto RRP_Return
  1872.     Endif
  1873.     DeleteRegValue $(RRP_KeyClient) $(RRP_Protocol)
  1874.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1875.         Goto RRP_Return
  1876.     Endif
  1877.     DeleteRegValue $(RRP_KeyServer) $(RRP_Protocol)
  1878.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1879.         Goto RRP_Return
  1880.     Endif
  1881.     Set RegistryErrorIndex = NO_ERROR
  1882. RRP_Return = +
  1883.     Ifstr(i) $(RRP_KeyServer) != $(KeyNull)
  1884.         CloseRegKey $(RRP_KeyServer)
  1885.     Endif
  1886.     Ifstr(i) $(RRP_KeyClient) != $(KeyNull)
  1887.         CloseRegKey $(RRP_KeyClient)
  1888.     Endif
  1889.     Ifstr(i) $(RRP_KeyRpc) != $(KeyNull)
  1890.         CloseRegKey $(RRP_KeyRpc)
  1891.     Endif
  1892.     Return  $(RegistryErrorIndex)
  1893. [RemoveClientRpcProtocol]
  1894.     Set RRP_Protocol = $($0)
  1895.     read-syms InitBaseVars
  1896.     Set RRP_KeyRpc = $(KeyNull)
  1897.     Set RRP_KeyRpcClient = $(KeyNull)
  1898.     Set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  1899.     OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft\Rpc" $(MAXIMUM_ALLOWED) RRP_KeyRpc
  1900.     Ifstr(i) $(RRP_KeyRpc) == $(KeyNull)
  1901.        Goto RRP_Return
  1902.     Endif
  1903.     OpenRegKey $(RRP_KeyRpc) "" "ClientProtocols" $(MAXIMUM_ALLOWED) RRP_KeyClient
  1904.     Ifstr(i) $(RRP_KeyClient) == $(KeyNull)
  1905.        Goto RRP_Return
  1906.     Endif
  1907.     DeleteRegValue $(RRP_KeyClient) $(RRP_Protocol)
  1908.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1909.         Goto RRP_Return
  1910.     Endif
  1911.     Set RegistryErrorIndex = NO_ERROR
  1912. RRP_Return = +
  1913.     Ifstr(i) $(RRP_KeyClient) != $(KeyNull)
  1914.         CloseRegKey $(RRP_KeyClient)
  1915.     Endif
  1916.     Ifstr(i) $(RRP_KeyRpc) != $(KeyNull)
  1917.         CloseRegKey $(RRP_KeyRpc)
  1918.     Endif
  1919.     Return  $(RegistryErrorIndex)
  1920. [RemoveServerRpcProtocol]
  1921.     Set RRP_Protocol = $($0)
  1922.     read-syms InitBaseVars
  1923.     Set RRP_KeyRpc = $(KeyNull)
  1924.     Set RRP_KeyRpcServer = $(KeyNull)
  1925.     Set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  1926.     OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft\Rpc" $(MAXIMUM_ALLOWED) RRP_KeyRpc
  1927.     Ifstr(i) $(RRP_KeyRpc) == $(KeyNull)
  1928.        Goto RRP_Return
  1929.     Endif
  1930.     OpenRegKey $(RRP_KeyRpc) "" "ServerProtocols" $(MAXIMUM_ALLOWED) RRP_KeyServer
  1931.     Ifstr(i) $(RRP_KeyServer) == $(KeyNull)
  1932.        Goto RRP_Return
  1933.     Endif
  1934.     DeleteRegValue $(RRP_KeyServer) $(RRP_Protocol)
  1935.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1936.         Goto RRP_Return
  1937.     Endif
  1938.     Set RegistryErrorIndex = NO_ERROR
  1939. RRP_Return = +
  1940.     Ifstr(i) $(RRP_KeyServer) != $(KeyNull)
  1941.         CloseRegKey $(RRP_KeyServer)
  1942.     Endif
  1943.     Ifstr(i) $(RRP_KeyRpc) != $(KeyNull)
  1944.         CloseRegKey $(RRP_KeyRpc)
  1945.     Endif
  1946.     Return  $(RegistryErrorIndex)
  1947. [GetInfFileNameFromRegistry]
  1948.     read-syms InitBaseVars
  1949.     set KeyProduct = $($0)
  1950.     set InfName = ""
  1951.     OpenRegKey $(KeyProduct) "" "NetRules" $(!REG_KEY_READ) NetRuleKey
  1952.     Ifstr(i) $(NetRuleKey) != $(KeyNull)
  1953.         GetRegValue $(NetRuleKey) "InfName" NetRuleInfNameList
  1954.         set NetRuleInfName = *($(NetRuleInfNameList), 4)
  1955.         Split-String $(NetRuleInfName), "\", FilenameList
  1956.         QueryListSize ListSize $(FilenameList)
  1957.         set InfName = *($(FilenameList), $(ListSize))
  1958.         CloseRegKey $(NetRuleKey)
  1959.     endif
  1960.     return $(InfName)
  1961. [ToggleBinding]
  1962.     Set SvcName = $($0)
  1963.     Set BindNumber = $($1)
  1964.     Set Action = $($2)
  1965.     Set Status = UNABLE_ACCESS_CONFIGURE_SERVICE
  1966.     Set KeySvc = ""
  1967.     Set KeyFrom = ""
  1968.     Set KeyTo = ""
  1969.     read-syms InitBaseVars
  1970.     OpenRegKey $(!REG_H_LOCAL) "" $(ServicesBaseName)"\"$(SvcName) $(MAXIMUM_ALLOWED) KeySvc
  1971.     Ifstr(i) $(KeySvc) == $(KeyNull)
  1972.         Debug-Output "UTILITY.INF: ToggleBinding: service key open FAILED"
  1973.         Goto TB_Return
  1974.     Endif
  1975.     Ifstr(i) $(Action) == activate
  1976.         Set FromKeyName = "Linkage\Disabled"
  1977.         Set ToKeyName   = "Linkage"
  1978.     Else
  1979.         Set FromKeyName = "Linkage"
  1980.         Set ToKeyName   = "Linkage\Disabled"
  1981.     Endif
  1982.     OpenRegKey $(KeySvc) "" $(FromKeyName) $(MAXIMUM_ALLOWED) KeyFrom
  1983.     Ifstr(i) $(KeyFrom) == $(KeyNull)
  1984.         Debug-Output "UTILITY.INF: ToggleBinding: from linkage key open FAILED"
  1985.         Goto TB_Return
  1986.     Endif
  1987.     OpenRegKey $(KeySvc) "" $(ToKeyName) $(MAXIMUM_ALLOWED) KeyTo
  1988.     Ifstr(i) $(KeyTo) == $(KeyNull)
  1989.         Debug-Output "UTILITY.INF: ToggleBinding: to linkage key open FAILED"
  1990.         Goto TB_Return
  1991.     Endif
  1992.     Set FromBindList   = {}
  1993.     Set FromExportList = {}
  1994.     Set FromRouteList  = {}
  1995.     Set ToBindList     = {}
  1996.     Set ToExportList   = {}
  1997.     Set ToRouteList    = {}
  1998.     Set ErrorTotal     = 0
  1999.     Debug-Output "UTILITY.INF: ToggleBinding; fetch all linkage values"
  2000.     GetRegValue $(KeyFrom),"Bind",TempValue
  2001.     Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2002.         Set FromBindList = *($(TempValue),4)
  2003.         Set-add ErrorTotal = $(ErrorTotal),1
  2004.     Endif
  2005.     GetRegValue $(KeyFrom),"Export",TempValue
  2006.     Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2007.         Set FromExportList = *($(TempValue),4)
  2008.         Set-add ErrorTotal = $(ErrorTotal),1
  2009.     Endif
  2010.     GetRegValue $(KeyFrom),"Route",TempValue
  2011.     Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2012.         Set FromRouteList = *($(TempValue),4)
  2013.         Set-add ErrorTotal = $(ErrorTotal),1
  2014.     Endif
  2015.     GetRegValue $(KeyTo),"Bind",TempValue
  2016.     Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2017.         Set ToBindList = *($(TempValue),4)
  2018.         Set-add ErrorTotal = $(ErrorTotal),1
  2019.     Endif
  2020.     GetRegValue $(KeyTo),"Export",TempValue
  2021.     Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2022.         Set ToExportList = *($(TempValue),4)
  2023.         Set-add ErrorTotal = $(ErrorTotal),1
  2024.     Endif
  2025.     GetRegValue $(KeyTo),"Route",TempValue
  2026.     Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2027.         Set ToRouteList = *($(TempValue),4)
  2028.         Set-add ErrorTotal = $(ErrorTotal),1
  2029.     Endif
  2030.     Ifint $(ErrorTotal) != 6
  2031.         Debug-Output "UTILITY.INF: ToggleBinding; Bind list retreival error, "$(ErrorTotal)
  2032.     Endif
  2033.     Debug-Output "UTILITY.INF: ToggleBinding; sanity check results"
  2034.     QueryListSize sz1 $(FromBindList)
  2035.     QueryListSize sz2 $(FromExportList)
  2036.     QueryListSize sz3 $(FromRouteList)
  2037.     Ifint $(sz1) != $(sz2)
  2038.         Goto TB_Return
  2039.     Endif
  2040.     Ifint $(sz1) != $(sz3)
  2041.         Goto TB_Return
  2042.     Endif
  2043.     QueryListSize sz2 $(ToBindList)
  2044.     QueryListSize sz3 $(ToExportList)
  2045.     QueryListSize sz4 $(ToRouteList)
  2046.     Ifint $(sz2) != $(sz3)
  2047.         Goto TB_Return
  2048.     Endif
  2049.     Ifint $(sz2) != $(sz4)
  2050.         Goto TB_Return
  2051.     Endif
  2052.     Debug-Output "UTILITY.INF: ToggleBinding; prepare to move binding"
  2053.     Ifint $(BindNumber) > $(sz1)
  2054.         Debug-Output "UTILITY.INF: ToggleBinding; binding to move was invalid"
  2055.         Set Status = INVALID_DATA_PASSED
  2056.     Endif
  2057.     Set FromBindItem   = *($(FromBindList),$(BindNumber))
  2058.     Set FromRouteItem  = *($(FromRouteList),$(BindNumber))
  2059.     Set FromExportItem = *($(FromExportList),$(BindNumber))
  2060.     Set ToBindList   = >($(ToBindList),$(FromBindItem))
  2061.     Set ToRouteList  = >($(ToRouteList),$(FromRouteItem))
  2062.     Set ToExportList = >($(ToExportList),$(FromExportItem))
  2063.     Set NewBind   = {}
  2064.     Set NewExport = {}
  2065.     Set NewRoute  = {}
  2066.     Set Index = 0
  2067.     ForListDo $(FromBindList)
  2068.         Set-add Index = $(Index),1
  2069.         Ifint $(Index) != $(BindNumber)
  2070.             Set NewBind   = >($(NewBind),$($))
  2071.             Set NewExport = >($(NewExport),*($(FromExportList),$(Index)))
  2072.             Set NewRoute  = >($(NewRoute),*($(FromRouteList),$(Index)))
  2073.         Endif
  2074.     EndForListDo
  2075.     Set FromBindList   = $(NewBind)
  2076.     Set FromExportList = $(NewExport)
  2077.     Set FromRouteList  = $(NewRoute)
  2078.     Set ErrorTotal = 0
  2079.     SetRegValue $(KeyFrom) {Bind,$(NoTitle),$(!REG_VT_MULTI_SZ),$(FromBindList)}
  2080.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  2081.         Set-add ErrorTotal = $(ErrorTotal),1
  2082.     Endif
  2083.     SetRegValue $(KeyFrom) {Export,$(NoTitle),$(!REG_VT_MULTI_SZ),$(FromExportList)}
  2084.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  2085.         Set-add ErrorTotal = $(ErrorTotal),1
  2086.     Endif
  2087.     SetRegValue $(KeyFrom) {Route,$(NoTitle),$(!REG_VT_MULTI_SZ),$(FromRouteList)}
  2088.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  2089.         Set-add ErrorTotal = $(ErrorTotal),1
  2090.     Endif
  2091.     SetRegValue $(KeyTo) {Bind,$(NoTitle),$(!REG_VT_MULTI_SZ),$(ToBindList)}
  2092.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  2093.         Set-add ErrorTotal = $(ErrorTotal),1
  2094.     Endif
  2095.     SetRegValue $(KeyTo) {Export,$(NoTitle),$(!REG_VT_MULTI_SZ),$(ToExportList)}
  2096.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  2097.         Set-add ErrorTotal = $(ErrorTotal),1
  2098.     Endif
  2099.     SetRegValue $(KeyTo) {Route,$(NoTitle),$(!REG_VT_MULTI_SZ),$(ToRouteList)}
  2100.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  2101.         Set-add ErrorTotal = $(ErrorTotal),1
  2102.     Endif
  2103.     Debug-Output "UTILITY.INF: ToggleBinding; Registry update error total = "$(ErrorTotal)
  2104.     Ifint $(ErrorTotal) != 0
  2105.        Set Status = UNABLE_WRITE_REGISTRY
  2106.     Else
  2107.        Set Status = NO_ERROR
  2108.     Endif
  2109. TB_Return = +
  2110.     Ifstr(i) $(KeyFrom) != $(KeyNull)
  2111.        CloseRegKey $(KeyFrom)
  2112.     Endif
  2113.     Ifstr(i) $(KeyTo) != $(KeyNull)
  2114.        CloseRegKey $(KeyTo)
  2115.     Endif
  2116.     Ifstr(i) $(KeySvc) != $(KeyNull)
  2117.        CloseRegKey $(KeySvc)
  2118.     Endif
  2119.     Return $(Status)
  2120. [SortListIndex]
  2121.     Set List = $($0)
  2122.     Set BoolAscend = $($1)
  2123.     Set BoolCaseSens = $($2)
  2124.     LibraryProcedure IndexList, $(!LIBHANDLE), GenerateSortedIndexList, $(List), $(BoolAscend), $(BoolCaseSens)
  2125.     Return $(IndexList)
  2126. [SortByIndex]
  2127.    Set List = $($0)
  2128.    Set IndexList = $($1)
  2129.    Set NewList = {}
  2130.    ForListDo $(IndexList)
  2131.       Set Index = $($)
  2132.       Set Item = *($(List),$(Index))
  2133.       Set NewList = >($(NewList),$(Item))
  2134.    EndForListDo
  2135.    Return $(NewList)
  2136. [SortList]
  2137.     Set List = $($0)
  2138.     Shell "" SortListIndex $(List) $($1) $($2)
  2139.     Set IndexList = $($R0)
  2140.     Shell "" SortByIndex $(List) $(IndexList)
  2141.     Set ResultList = $($R0)
  2142.     return $(ResultList)
  2143. [DetectionDllFiles]
  2144.     DetectionDllsFound = {} ? $(!LIBHANDLE) FindFileInstances $(!STF_WINDOWSSYSPATH)"\???ncdet.dll"
  2145. [UpdateDetectionDllNames]
  2146.     Set Status = STATUS_FAILED
  2147.     read-syms InitBaseVars
  2148.     Detect DetectionDllFiles
  2149.     Set DllValueName = "NetcardDlls"
  2150.     OpenRegKey $(!REG_H_LOCAL) "" "System\Setup" $(MAXIMUM_ALLOWED) KeySetup
  2151.     Ifstr(i) $(KeySetup) == $(KeyNull)
  2152.         Debug-Output "UTILITY.INF: [UpdateDetectionDllNames] cant open System\Setup key"
  2153.         Goto UDDN_Return
  2154.     Endif
  2155.     Set NewDllList = {"MSNCDET.DLL"}
  2156.     ForListDo $(DetectionDllsFound)
  2157.         Set NewDllList = >($(NewDllList),$($))
  2158.     EndForListDo
  2159.     Set UpdateRequired = 1
  2160.     GetRegValue $(KeySetup) $(DllValueName) DllNamesValue
  2161.     Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2162.         Set DllNames = *($(DllNamesValue),4)
  2163.         Debug-Output "UTILITY.INF: [UpdateDetectionDllNames] DllNames = "$(DllNames)
  2164.         Set UpdateRequired = 0
  2165.         ForListDo $(NewDllList)
  2166.             Set DllIndex = ~($(DllNames),$($))
  2167.             Ifint $(DllIndex) == 0
  2168.                 Set UpdateRequired = 1
  2169.             Endif
  2170.         EndForListDo
  2171.     Endif
  2172.     Set Status = STATUS_SUCCESSFUL
  2173.     Ifint $(UpdateRequired) == 1
  2174.         Debug-Output "UTILITY.INF: [UpdateDetectionDllNames] new DLL names = "$(NewDllList)
  2175.         Set ValueInfo = {$(DllValueName), $(NoTitle), $(!REG_VT_MULTI_SZ), $(NewDllList)}
  2176.         SetRegValue $(KeySetup) $(ValueInfo)
  2177.         Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  2178.             Set Status = STATUS_FAILED
  2179.         Else
  2180.             Shell "NCPARAM.INF" Param_ControlDetection DTEND
  2181.             Shell "NCPARAM.INF" Param_ControlDetection DTSTART
  2182.         Endif
  2183.     Else
  2184.         Set Status = STATUS_USERCANCEL
  2185.     Endif
  2186.     CloseRegKey $(KeySetup)
  2187. UDDN_Return = +
  2188.     Return $(Status)
  2189. [CheckIfCopyNecessary]
  2190.     Set Status = STATUS_SUCCESSFUL
  2191.     Set PathList = $($0)
  2192.     Set NamesList = $($1)
  2193.     Set Index = 0
  2194.     Set Found = 1
  2195.     ForListDo $(PathList)
  2196.         Set ThisPath = $($)
  2197.         Set-add Index = Index,1
  2198.         Set NameList = *($(NamesList),$(Index))
  2199.         ForListDo $(NameList)
  2200.             Set FileToCheck = $(ThisPath)\$($)
  2201.             LibraryProcedure FilePresent,$(!LIBHANDLE), CheckFileExistance $(FileToCheck)
  2202.             Ifstr(i) $(FilePresent) != "YES"
  2203.                 Set Found = 0
  2204.             Endif
  2205.         EndForListDo
  2206.     EndForListDo
  2207.     Ifint $(Found) != 1
  2208.         Set Status = STATUS_FAILED
  2209.     Endif
  2210.     Return $(Status)
  2211. [GetBusTypeDialog]
  2212.     set CardName = $($0)
  2213.     set BusInterfaceType = $($1)
  2214.     set BusNumber = $($2)
  2215.     set DlgReturn = ""
  2216.     ifstr(i) $(BusInterfaceType) == ""
  2217.         set BusInterfaceType = 1        
  2218.     endif
  2219.     ifstr(i) $(BusNumber) == ""
  2220.         set BusNumber = 0               
  2221.     endif
  2222.     set FLibraryErrCtl = 1
  2223.     LibraryProcedure BusInfo $(!NCPA_HANDLE), GetBusTypeDialog, $(!STF_HWND), $(CardName), $(BusInterfaceType), $(BusNumber)
  2224.     set FLibraryErrCtl = 0
  2225.     ifint *($(BusInfo),1) == 0
  2226.         set ReturnValue = NO_ERROR
  2227.         set BusInterfaceType = *($(BusInfo),2)
  2228.         set BusNumber = *($(BusInfo),3)
  2229.         set DlgReturn = *($(BusInfo),4)
  2230.     else
  2231.         set ReturnValue = ERROR
  2232.     endif
  2233.     Return $(ReturnValue), $(BusInterfaceType), $(BusNumber), $(DlgReturn)
  2234. [SetMasterComponent]
  2235.     Read-syms InitBaseVars
  2236.     Set Vendor         = $($0)
  2237.     Set Product        = $($1)
  2238.     Set InfName        = $($2)
  2239.     Set InfOption      = $($3)
  2240.     Set Adding         = 1
  2241.     Ifstr(i) $($4) == REMOVE
  2242.        Set Adding = 0
  2243.     Endif
  2244.     Set Status         = STATUS_FAILED
  2245.     Set Error          = ""
  2246.     Set InfNamesList   = {}
  2247.     Set InfOptionsList = {}
  2248.     Set InfIndex       = 0
  2249.     Set NameListSize   = 0
  2250.     Set OptionListSize = 0
  2251.     Set UpdateRequired = 0
  2252.     Set MasterKey      = ""
  2253.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\"$(Vendor)"\"$(Product)"\CurrentVersion" +
  2254.               $(MAXIMUM_ALLOWED) MasterKey
  2255.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  2256.         Set Error = CANNOT_FIND_COMPONENT_SERVICE
  2257.         Debug-Output "UTILITY.INF: Cant open master component key: "$(Product)
  2258.         Goto SMC_Return
  2259.     Endif
  2260.     GetRegValue $(MasterKey) DependentInfNames InfNamesValue
  2261.     Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2262.         Set InfNamesList = *($(InfNamesValue),4)
  2263.         Set InfIndex = ~($(InfNamesList),$(InfName))
  2264.         QueryListSize NameListSize $(InfNamesList)
  2265.     Endif
  2266.     GetRegValue $(MasterKey) DependentInfOptions InfOptionsValue
  2267.     Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2268.         Set InfOptionsList = *($(InfOptionsValue),4)
  2269.         QueryListSize OptionListSize $(InfOptionsList)
  2270.     Endif
  2271.     Ifint $(NameListSize) != $(OptionListSize)
  2272.         Set Error = UNABLE_INSTALL
  2273.         Debug-Output "UTILITY.INF: Dependent INF list degenerate: "$(Product)
  2274.         Goto SMC_Return
  2275.     Endif
  2276.     Ifint $(Adding) == 1
  2277.         Ifint $(InfIndex) == 0
  2278.             Set UpdateRequired = 1
  2279.             Set InfNamesList = >($(InfNamesList),$(InfName))
  2280.             Set InfOptionsList = >($(InfOptionsList),$(InfOption))
  2281.         Endif
  2282.     Else
  2283.         Ifint $(InfIndex) != 0
  2284.             Set UpdateRequired = 1
  2285.             Set TlistNames = {}
  2286.             Set TlistOptions = {}
  2287.             Set Tindex = 0
  2288.             ForListDo $(InfNamesList)
  2289.                 Set-add Tindex = $(Tindex), 1
  2290.                 Ifstr(i) $($) != $(InfName)
  2291.                     Set TlistNames = >($(TlistNames),$($))
  2292.                     Set TlistOptions = >($(TlistOptions),*($(InfOptionsList),$(Tindex)))
  2293.                 Endif
  2294.             EndForListDo
  2295.             Set InfNamesList = TlistNames
  2296.             Set InfOptionsList = TlistOptions
  2297.         Endif
  2298.     Endif
  2299.     Set Status = STATUS_SUCCESSFUL
  2300.     Ifint $(UpdateRequired) == 0
  2301.         Goto SMC_Return
  2302.     Endif
  2303.     SetRegValue $(MasterKey) {DependentInfNames,$(NoTitle),$(!REG_VT_MULTI_SZ),$(InfNamesList)}
  2304.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  2305.         Debug-Output "UTILITY.INF: master component value update failed (1)"
  2306.         Set Status = UNABLE_WRITE_REGISTRY
  2307.     Endif
  2308.     SetRegValue $(MasterKey) {DependentInfOptions,$(NoTitle),$(!REG_VT_MULTI_SZ),$(InfOptionsList)}
  2309.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  2310.         Debug-Output "UTILITY.INF: master component value update failed (2)"
  2311.         Set Status = UNABLE_WRITE_REGISTRY
  2312.     Endif
  2313. SMC_Return =+
  2314.     Ifstr(i) $(MasterKey) != $(KeyNull)
  2315.        CloseRegKey $(MasterKey)
  2316.     Endif
  2317.     Return $(Status) $(Error)
  2318. [RemoveDependentComponents]
  2319.     Read-syms InitBaseVars
  2320.     Set Vendor         = $($0)
  2321.     Set Product        = $($1)
  2322.     Set Status         = STATUS_FAILED
  2323.     Set Error          = ""
  2324.     Set InfNamesList   = {}
  2325.     Set InfOptionsList = {}
  2326.     Set InfIndex       = 0
  2327.     Set NameListSize   = 0
  2328.     Set OptionListSize = 0
  2329.     Set UpdateRequired = 0
  2330.     Set MasterKey      = ""
  2331.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\"$(Vendor)"\"$(Product)"\CurrentVersion" +
  2332.               $(MAXIMUM_ALLOWED) MasterKey
  2333.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  2334.         Debug-Output "UTILITY.INF: Cant open master component key: "$(Product)
  2335.         Set Error = CANNOT_FIND_COMPONENT_SERVICE
  2336.         Goto RDC_Return
  2337.     Endif
  2338.     GetRegValue $(MasterKey) DependentInfNames InfNamesValue
  2339.     Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2340.         Set InfNamesList = *($(InfNamesValue),4)
  2341.         Set InfIndex = ~($(InfNamesList),$(InfName))
  2342.         QueryListSize NameListSize $(InfNamesList)
  2343.     Endif
  2344.     GetRegValue $(MasterKey) DependentInfOptions InfOptionsValue
  2345.     Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2346.         Set InfOptionsList = *($(InfOptionsValue),4)
  2347.         QueryListSize OptionListSize $(InfOptionsList)
  2348.     Endif
  2349.     Ifint $(NameListSize) != $(OptionListSize)
  2350.         Set Error = UNABLE_INSTALL
  2351.         Debug-Output "UTILITY.INF: Dependent INF list degenerate: "$(Product)
  2352.         Goto RDC_Return
  2353.     Endif
  2354.     Ifint $(NameListSize) == 0
  2355.         Set Status = STATUS_SUCCESSFUL
  2356.         Goto RDC_Return
  2357.     Endif
  2358.     Set OldOption = $(!NTN_InfOption)
  2359.     Set OldMode   = $(!NTN_InstallMode)
  2360.     Set OldInf    = $(!NTN_Infname)
  2361.     Set !NTN_InstallMode = deinstall
  2362.     Set Tindex = 0
  2363.     ForListDo $(InfNamesList)
  2364.         Set-add Tindex = $(Tindex), 1
  2365.         Set !NTN_InfOption = *($(InfOptionsList),$(Tindex))
  2366.         Set !NTN_Infname = $($)
  2367.         Debug-Output "UTILITY.INF: Removing "$(Product)" dependent: "$(InfName)":"$(InfOption)
  2368.         Shell $(!NTN_Infname) InstallOption $(!STF_LANGUAGE) $(!NTN_InfOption) $(!STF_SRCDIR) +
  2369.               $(!NtLmAddCopy) $(!NtLmDoCopy) $(!NtLmDoConfig)
  2370.     EndForListDo
  2371.     Set !NTN_InfOption   = $(OldOption)
  2372.     Set !NTN_InstallMode = $(OldMode)
  2373.     Set !NTN_Infname     = $(OldInf)
  2374.     Set Status = STATUS_SUCCESSFUL
  2375. RDC_Return =+
  2376.     Ifstr(i) $(MasterKey) != $(KeyNull)
  2377.        CloseRegKey $(MasterKey)
  2378.     Endif
  2379.     return $(Status) $(Error)
  2380. [AddDefaultNetCardParameters]
  2381.     set KeyParameter = $($0)
  2382.     ForListDo $(!NetCardParameterName)
  2383.         set Name = $($)
  2384.         set Value = *($(!NetCardParameterValue), $(#))
  2385.         ifstr(i) $(Name) == "NetworkAddress"
  2386.             set Type = $(!REG_VT_SZ)
  2387.         else
  2388.             set Type = $(!REG_VT_DWORD)
  2389.         endif
  2390.  Debug-Output "Name = "$(Name)
  2391.  Debug-Output "Value = "$(Value)
  2392.         SetRegValue $(KeyParameter) {$(Name),$(NoTitle),$(Type),$(Value)}
  2393.     EndForListDo
  2394.     return
  2395. [FindNextNetworkCard]
  2396.     read-syms InitBaseVars
  2397.     set NetcardName = $($0)
  2398.     set iSearch = $($1)
  2399.     set KeyNetcard = ""
  2400.     Debug-Output "Utility.Inf: FindNextNetworkCard "$(NetcardName)", "$(iSearch)
  2401. checknextnetcard = +
  2402.     set KeyName = $(NetworkCardKeyName)"\"$(iSearch)
  2403.     Debug-Output "Utility.Inf: FindNextNetworkCard, checking "$(KeyName)
  2404.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(MAXIMUM_ALLOWED) KeyNetcard
  2405.     set-add iSearch = $(iSearch), 1
  2406.     Ifstr $(KeyNetcard) != $(KeyNull)
  2407.         GetRegValue $(KeyNetcard) "ProductName" ValueList
  2408.         ifstr(i) $(NetcardName) != *($(ValueList),4)   
  2409.             CloseRegKey $(KeyNetcard)
  2410.             Debug-Output "Utility.Inf: FindNextNetworkCard, its not "*($(ValueList),4)" at "$(iSearch)
  2411.             goto checknextnetcard
  2412.         endif
  2413.         Debug-Output "Utility.Inf: FindNextNetworkCard, Found "*($(ValueList),4)" at "$(iSearch)
  2414.     else
  2415.         Debug-Output "Utility.Inf: FindNextNetworkCard, Last One "$(iSearch)
  2416.     endif
  2417.     Debug-Output "Utility.Inf: FindNextNetworkCard returning "$(KeyNetcard)","$(iSearch)
  2418.     return $(KeyNetcard) $(iSearch)
  2419. [AFDVars]
  2420. ProductAFDTitle         = "AFD Networking Support Environment"
  2421. ProductAFDName          = "Afd"
  2422. ProductAFDImagePath     = "\SystemRoot\System32\drivers\afd.sys"
  2423. ProductAFDSvcType       = "kernelautostart"
  2424. [RegistryErrorsENG]
  2425. UNABLE_ACCESS_SOFTWARE_REG,"Unable to access SOFTWARE subtree in Registry"
  2426. UNABLE_CREATE_MANUFACTURER_KEY,"Unable to create Manufacturer key in Registry"
  2427. UNABLE_OPEN_MICROSOFT_KEY,"Unable to open Microsoft subkey in Registry"
  2428. UNABLE_CREATE_PRODUCT_KEY,"Unable to create subkey in Registry for Windows NT"
  2429. UNABLE_CREATE_PRODUCT_VERSION,"Unable to create version subkey in Registry for Windows NT"
  2430. UNABLE_CREATE_NETRULES_KEY,"Unable to create a NetRules subkey in Registry"
  2431. UNABLE_OPEN_HARDWARE_SECTION,"Unable to open HARDWARE subkey in Registry"
  2432. UNABLE_OPEN_NETWORKCARD_SECTION,"Unable to open NetworkCards subkey in Registry"
  2433. UNABLE_OPEN_EVENTLOG_SUBKEY,"Unable to open Eventlog subkey in Registry"
  2434. UNABLE_CREATE_NETCARD_CONFIGURATION,"Unable to create entry for network adapter in Registry"
  2435. UNABLE_ACCESS_CONFIGURE_SERVICE,"Unable to access Services subkey in Registry"
  2436. UNABLE_CREATE_CONFIGURE_SERVICE,"Unable to create Services subkey in Registry"
  2437. UNABLE_CREATE_SERVICE_SUBKEY,"Unable to create Services subkey in Registry"
  2438. INVALID_DATA_PASSED,"Invalid data passed to Registry utility routine"
  2439. SERVICE_ALREADY_EXISTS,"Registry Service subkey already exists"
  2440. OPERATION_UNIMPLEMENTED,"Registry operation UNIMPLEMENTED"
  2441. CANNOT_FIND_COMPONENT_SERVICE,"Component service name not found or non-existent"
  2442. CANNOT_CONFIGURE_HARDWARE,"Cannot configure the hardware component"
  2443. CANNOT_CONFIGURE_SOFTWARE,"Cannot configure the software component"
  2444. UNABLE_WRITE_REGISTRY, "Cannot write to registry"
  2445. UNABLE_INSTALL, "Installation Error"
  2446. PROVIDER_ALREADY_EXISTED, "Provider already exists in Registry"
  2447. PROVIDER_ORDER_DOES_NOT_EXIST, "Provider order does not exist in Registry."
  2448. TCPIP_NONEXIST_ERROR, "Please install Microsoft TCP/IP before installing SNMP."
  2449. TCPIP_NONEXIST_ERROR_FTPD, "Please install Microsoft TCP/IP before installing FTP Server."
  2450. NO_BINDING_INFO, "Missing Binding Information. Please click BINDINGS button first."
  2451. CANNOT_OPEN_EVENTLOG_KEY, "Cannot open Eventlog subkey in Registry."
  2452. CANNOT_CREATE_SNMPPROXYKEY, "Cannot create SNMP Proxy subkey in Registry."
  2453. REF_COUNT_NOT_ZERO, "Please remove all related network adapter cards before removing the software driver."
  2454. UNABLE_REMOVE_CONFIGURE_SERVICE,"Unable to remove Services subkey for a software driver in Registry"
  2455. UNABLE_ACCESS_WINSOCK_MAP_INFO,"Unable to access WinSock mapping information in DLL"
  2456. VERIFY_WARNING,"The current netcard parameters are not verifiably correct and may result in usage problems or system failure.  Use them anyway?"
  2457. CANNOT_DETECT,"Setup is unable to obtain network adapter information from the associated network adapter DLL files.  Operation cannot continue."
  2458. UNABLE_COPY_FILE,"File copy operation failed."
  2459. ASK_SOURCE_FAIL,"Failed to obtain source file location."
  2460. SETUP_FAIL,"Setup operation failed."
  2461. SERVICE_MARKED_FOR_DELETE,"This network component has recently been removed. Please restart your computer before installing it again."
  2462. REBOOT_MACHINE_BEFORE_ADD_ADAPTER,"This network component has recently been removed. Please restart your computer before installing it again."
  2463. CANT_REMOVE_WKSTA_NTAS,"The Workstation cannot be removed on a Windows NT Domain Controller."
  2464. CANT_REMOVE_SERVER_NTAS,"The Server cannot be removed on a Windows NT Domain Controller."
  2465. NO_ERROR, ""
  2466. DLC_NONEXIST_ERROR, "Please install Microsoft DLC before installing Remoteboot."
  2467. NBF_NONEXIST_ERROR, "Please install the NetBEUI protocol before installing Remoteboot."
  2468. UNABLE_ADD_NAMESPACE_PROVIDER, "Unable to add software component as a Name Space Provider"
  2469. UNABLE_REMOVE_NAMESPACE_PROVIDER, "Unable to remove Name Space Provider"
  2470. [RegistryErrorUnknownENG]
  2471. Error_Bogus = "UNKNOWN REGISTRY FAILURE"
  2472. [VerExistedENG]
  2473. ver = " ver "
  2474. Text = " already exists on the system. Please use [Update] to update the software."
  2475. [CardExistedENG]
  2476. Text = "A network card of this type is already installed in the system. Do you want to continue?"
  2477. [ProgressCopyENG]
  2478.     ProCaption   = "Windows NT Networking Setup"
  2479.     ProCancel    = "Cancel"
  2480.     ProCancelMsg = "Windows NT is not correctly installed.  Are you sure you want "+
  2481.                    "to cancel copying files?"
  2482.     ProCancelCap = "Setup Message"
  2483.     ProText1     = "Copying:"
  2484.     ProText2     = "To:"
  2485.     Error        = "Unable to determine proper source disk location; copy cannot be performed."
  2486.